---
title: "Quantum Codes"
canonical: "https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/index-quantum-codes.html"
source: "https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/index-quantum-codes.md"
part: "Coding Theory"
chapter: "Quantum Codes"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Coding Theory", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/index-coding-theory.md"}
prev: {"title": "Automorphism Group", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/AdditiveCodes/additive-automorphisms.md"}
next: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/introduction.md"}
---

<a id="error-correcting-quantum-code"></a>
<a id="chap-codequantum"></a>
# Quantum Codes

- [Introduction](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/introduction.md)
- [Constructing Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md)
  - [Construction of General Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#construction-of-general-quantum-codes)
    - [`QuantumCode(S): Code → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcode-code)
    - [Example: Quantum Code from an Even Linear Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-1cf7b5)
    - [Example: Extended Format Stabilizer Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-ddc82a)
    - [Example: Self-Dual Quantum Code Construction](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-ca78b6)
    - [Example: Quantum Code from an Additive Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-f692ec)
    - [`QuantumCode(M): ModMatRngElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcode-modmatrngelt)
    - [Example: Quantum Code from a Stabilizer Matrix](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-863e76)
    - [`QuantumCode(G): Grph → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcode-grph)
    - [Example: Hexacode from a Wheel Graph](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-29ea9f)
    - [Example: Dodecacode from a Graph](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-d4d3a5)
    - [`RandomQuantumCode(F, n, k): FldFin, RngIntElt, RngIntElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-randomquantumcode-fldfin-rngintelt-rngintelt)
    - [Example: Random Quantum Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-27cad1)
    - [`Subcode(Q, k): CodeQuantum, RngIntElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-subcode-codequantum-rngintelt)
  - [Construction of Special Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#construction-of-special-quantum-codes)
    - [`Hexacode() → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-hexacode)
    - [`Dodecacode() → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-dodecacode)
  - [CSS Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#css-codes)
    - [`CSSCode(C1, C2): Code, Code → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-csscode-code-code)
    - [`CalderbankShorSteaneCode(C1, C2): Code, Code → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-calderbankshorsteanecode-code-code)
    - [Example: CSS Construction from a Hamming Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-37614f)
  - [Cyclic Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#cyclic-quantum-codes)
    - [`QuantumCyclicCode(v): ModTupFldElt → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcycliccode-modtupfldelt)
    - [`QuantumCyclicCode(Q): [ModTupFldElt] → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcycliccode-modtupfldelt-2)
    - [Example: Cyclic Quantum Code from a Vector](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-0477fe)
    - [`QuantumCyclicCode(n, f): RngIntElt, RngUPolElt → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcycliccode-rngintelt-rngupolelt)
    - [`QuantumCyclicCode(n, Q): RngIntElt, [RngUPolElt] → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcycliccode-rngintelt-rngupolelt-2)
    - [Example: Cyclic Quantum Codes from Polynomials](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-87e469)
    - [`QuantumCyclicCode(v4, v2): ModTupFldElt, ModTupFldElt → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumcycliccode-modtupfldelt-modtupfldelt)
    - [Example: Cyclic Quantum Code from Quaternary and Binary Vectors](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-088686)
  - [Quasi-Cyclic Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#quasi-cyclic-quantum-codes)
    - [`QuantumQuasiCyclicCode(n, Q): RngIntElt, SeqEnum[RngUPolElt] → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumquasicycliccode-rngintelt-seqenum-rngupolelt)
    - [`QuantumQuasiCyclicCode(Q): SeqEnum[ModTupFldElt] → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#function-quantumquasicycliccode-seqenum-modtupfldelt)
    - [Example: Quasi-Cyclic Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/creation.md#example-ex-efccba)
- [Access Functions](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md)
  - [`QuantumBasisElement(F): FldFin → FldFinElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-quantumbasiselement-fldfin)
  - [Example: Quantum Basis Element](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#example-ex-2560f5)
  - [`StabilizerCode(Q): CodeQuantum → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilizercode-codequantum)
  - [`StabiliserCode(Q): CodeQuantum → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilisercode-codequantum)
  - [`StabilizerMatrix(Q): CodeQuantum → ModMatFldElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilizermatrix-codequantum)
  - [`StabiliserMatrix(Q): CodeQuantum → ModMatFldElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilisermatrix-codequantum)
  - [`NormalizerCode(Q): CodeQuantum → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-normalizercode-codequantum)
  - [`NormaliserCode(Q): CodeQuantum → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-normalisercode-codequantum)
  - [`NormalizerMatrix(Q): CodeQuantum → ModMatFldElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-normalizermatrix-codequantum)
  - [`NormaliserMatrix(Q): CodeQuantum → ModMatFldElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-normalisermatrix-codequantum)
  - [Quantum Error Group](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#quantum-error-group)
    - [`QuantumErrorGroup(p, n): RngIntElt, RngIntElt → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-quantumerrorgroup-rngintelt-rngintelt)
    - [`QuantumBinaryErrorGroup(n): RngIntElt → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-quantumbinaryerrorgroup-rngintelt)
    - [Example: Commutativity in the Quantum Error Group](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#example-ex-442960)
    - [`QuantumErrorGroup(Q): CodeQuantum → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-quantumerrorgroup-codequantum)
    - [`StabilizerGroup(Q): CodeQuantum → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilizergroup-codequantum)
    - [`StabiliserGroup(Q): CodeQuantum → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilisergroup-codequantum)
    - [`StabilizerGroup(Q, G): CodeQuantum, GrpPC → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilizergroup-codequantum-grppc)
    - [`StabiliserGroup(Q, G): CodeQuantum, GrpPC → GrpPC`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#function-stabilisergroup-codequantum-grppc)
    - [Example: Stabilizer Group of a Quantum Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#example-ex-1844d0)
    - [Example: Compatible Stabilizer Groups](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/access.md#example-ex-8f08f4)
- [Inner Products and Duals](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md)
  - [`SymplecticInnerProduct(v1, v2): ModTupFldElt, ModTupFldElt → FldFinElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#function-symplecticinnerproduct-modtupfldelt-modtupfldelt)
  - [Example: Symplectic Products Compared](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#example-ex-176f6b)
  - [Example: Symplectic Product Formats](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#example-ex-f66c0e)
  - [`SymplecticDual(C): CodeAdd → CodeAdd`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#function-symplecticdual-codeadd)
  - [`IsSymplecticSelfDual(C): CodeAdd → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#function-issymplecticselfdual-codeadd)
  - [`IsSymplecticSelfOrthogonal(C): CodeAdd → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#function-issymplecticselforthogonal-codeadd)
  - [Example: Symplectically Orthogonal Vectors](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#example-ex-b98847)
  - [Example: Symplectic Self-Orthogonality of Vectors](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/inner-products.md#example-ex-937695)
- [Weight Distribution and Minimum Weight](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md)
  - [`WeightDistribution(Q): CodeQuantum → SeqEnum, SeqEnum, SeqEnum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#function-weightdistribution-codequantum)
  - [Example: Weight Distributions of a Quantum Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#example-ex-839de5)
  - [`MinimumWeight(Q): CodeQuantum → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#function-minimumweight-codequantum)
  - [Example: Minimum Weight of a Quantum Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#example-ex-9556d5)
  - [`IsPure(Q): CodeQuantum → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#function-ispure-codequantum)
  - [Example: Purity of Best Known Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/weight-distribution.md#example-ex-e05555)
- [New Codes From Old](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md)
  - [`DirectSum(Q1, Q2): CodeQuantum, CodeQuantum → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-directsum-codequantum-codequantum)
  - [`ExtendCode(Q): CodeQuantum → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-extendcode-codequantum)
  - [`ExtendCode(Q, m): CodeQuantum, RngIntElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-extendcode-codequantum-rngintelt)
  - [`PunctureCode(Q, i): CodeQuantum, RngIntElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-puncturecode-codequantum-rngintelt)
  - [`PunctureCode(Q, I): CodeQuantum, SetEnum → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-puncturecode-codequantum-setenum)
  - [`ShortenCode(Q, i): CodeQuantum, RngIntElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-shortencode-codequantum-rngintelt)
  - [`ShortenCode(Q, I): CodeQuantum, SetEnum → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#function-shortencode-codequantum-setenum)
  - [`C ^ tau: CodeQuantum, GrpPermElt → CodeQuantum`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#operation-op-pow-codequantum-grppermelt)
  - [Example: Combining Stabilizer Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/combining-codes.md#example-ex-31e314)
- [Best Known Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md)
  - [`QECC(F, n, k): FldFin, RngIntElt, RngIntElt → CodeQuantum, BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#function-qecc-fldfin-rngintelt-rngintelt)
  - [`BKQC(F, n, k): FldFin, RngIntElt, RngIntElt → CodeQuantum, BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#function-bkqc-fldfin-rngintelt-rngintelt)
  - [`BestKnownQuantumCode(F, n, k): FldFin, RngIntElt, RngIntElt → CodeQuantum, BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#function-bestknownquantumcode-fldfin-rngintelt-rngintelt)
  - [Example: Weight Distribution of a Best Known Quantum Code](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#example-ex-4ef878)
  - [Example: Self-Dual Quantum Codes](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#example-ex-aece57)
  - [Example: Tracing a Best Known Quantum Code Construction](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-codes.md#example-ex-e5b5cc)
- [Best Known Bounds](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-bounds.md)
  - [`QECCLowerBound(F, n, k): FldFin, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-bounds.md#function-qecclowerbound-fldfin-rngintelt-rngintelt)
  - [`QECCUpperBound(F, n, k): FldFin, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-bounds.md#function-qeccupperbound-fldfin-rngintelt-rngintelt)
  - [Example: Best Known Quantum Bounds](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/best-known-quantum-bounds.md#example-ex-9d1cfb)
- [Automorphism Group](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/additive-automorphisms.md)
  - [`AutomorphismGroup(Q): CodeQuantum → GrpPerm`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/additive-automorphisms.md#function-automorphismgroup-codequantum)
  - [`PermutationGroup(Q): CodeQuantum → GrpPerm`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/additive-automorphisms.md#function-permutationgroup-codequantum)
  - [Example: Automorphism Group of the Dodecacode](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/additive-automorphisms.md#example-ex-9f0d8a)
  - [Example: Automorphism Groups of the Hexacode](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/additive-automorphisms.md#example-ex-320db8)
- [Hilbert Spaces](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md)
  - [`HilbertSpace(F, n): FldCom, RngIntElt → HilbSpc`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-hilbertspace-fldcom-rngintelt)
  - [`Field(H): HilbSpc → FldCom`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-field-hilbspc)
  - [`NumberOfQubits(H): HilbSpc → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-numberofqubits-hilbspc)
  - [`Nqubits(H): HilbSpc → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-nqubits-hilbspc)
  - [`Dimension(H): HilbSpc → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-dimension-hilbspc)
  - [`IsDenselyRepresented(H): HilbSpc → RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-isdenselyrepresented-hilbspc)
  - [`H1 eq H2: HilbSpc, HilbSpc → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-eq-hilbspc-hilbspc)
  - [`H1 ne H2: HilbSpc, HilbSpc → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-ne-hilbspc-hilbspc)
  - [Example: Dense and Sparse Hilbert Spaces](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-a2ce0e)
  - [Creation of Quantum States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#creation-of-quantum-states)
    - [`QuantumState(H, v): HilbSpc, ModTupFldElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-quantumstate-hilbspc-modtupfldelt)
    - [`QuantumState(H, v): HilbSpc, MtrxSprs → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-quantumstate-hilbspc-mtrxsprs)
    - [`H ! i: HilbSpc, RngIntElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-hilbspc-rngintelt)
    - [`H ! s: HilbSpc, [RngIntElt] → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-hilbspc-rngintelt-2)
    - [`SetPrintKetsInteger(b): BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-setprintketsinteger-boolelt)
    - [Example: Quantum State from a Coefficient Vector](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-1f7466)
    - [Example: Quantum State from Basis States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-9b3454)
  - [Manipulation of Quantum States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#manipulation-of-quantum-states)
    - [`a * e: FldComElt, HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-times-fldcomelt-hilbspcelt)
    - [`- e: HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-operation-hilbspcelt-hilbspcelt)
    - [`e1 + e2: HilbSpcElt, HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-plus-hilbspcelt-hilbspcelt)
    - [`e1 - e2: HilbSpcElt, HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-minus-hilbspcelt-hilbspcelt)
    - [`Normalisation(e): HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-normalisation-hilbspcelt)
    - [`Normalisation(~e): HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-normalisation-hilbspcelt-ref)
    - [`Normalization(e): HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-normalization-hilbspcelt)
    - [`Normalization(~e): HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-normalization-hilbspcelt-ref)
    - [`NormalisationCoefficient(e): HilbSpc → FldComElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-normalisationcoefficient-hilbspc)
    - [`NormalizationCoefficient(e): HilbSpc → FldComElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-normalizationcoefficient-hilbspc)
    - [`e1 eq e2: HilbSpcElt, HilbSpcElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-eq-hilbspcelt-hilbspcelt)
    - [`e1 ne e2: HilbSpcElt, HilbSpcElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#operation-op-ne-hilbspcelt-hilbspcelt)
    - [Example: Normalisation of Quantum States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-d9a8c5)
  - [Inner Product and Probabilities of Quantum States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#inner-product-and-probabilities-of-quantum-states)
    - [`InnerProduct(e1, e2): HilbSpcElt, HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-innerproduct-hilbspcelt-hilbspcelt)
    - [`ProbabilityDistribution(e): HilbSpcElt → Mtrx`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-probabilitydistribution-hilbspcelt)
    - [`Probability(e, i): HilbSpcElt, RngIntElt → FldReElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-probability-hilbspcelt-rngintelt)
    - [`Probability(e, v): HilbSpcElt, RngIntElt → FldReElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-probability-hilbspcelt-rngintelt-2)
    - [`PrintProbabilityDistribution(e): HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-printprobabilitydistribution-hilbspcelt)
    - [`PrintSortedProbabilityDistribution(e): HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-printsortedprobabilitydistribution-hilbspcelt)
    - [Example: Probabilities of a Quantum State](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-c0f168)
    - [Example: Sorted Probabilities of a Quantum State](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-10594e)
  - [Unitary Transformations on Quantum States](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#unitary-transformations-on-quantum-states)
    - [`BitFlip(e, k): HilbSpcElt, RngIntElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-bitflip-hilbspcelt-rngintelt)
    - [`BitFlip(~e, k): HilbSpcElt, RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-bitflip-hilbspcelt-rngintelt-ref)
    - [`BitFlip(e, B): HilbSpcElt, {RngIntElt} → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-bitflip-hilbspcelt-rngintelt-2)
    - [`BitFlip(~e, B): HilbSpcElt, {RngIntElt}`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-bitflip-hilbspcelt-rngintelt-ref-2)
    - [`PhaseFlip(e, k): HilbSpcElt, RngIntElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-phaseflip-hilbspcelt-rngintelt)
    - [`PhaseFlip(~e, k): HilbSpcElt, RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-phaseflip-hilbspcelt-rngintelt-ref)
    - [`PhaseFlip(e, B): HilbSpcElt, {RngIntElt} → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-phaseflip-hilbspcelt-rngintelt-2)
    - [`PhaseFlip(~e, B): HilbSpcElt, {RngIntElt}`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-phaseflip-hilbspcelt-rngintelt-ref-2)
    - [`ControlledNot(e, B, k): HilbSpcElt, {RngIntElt}, RngIntElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-controllednot-hilbspcelt-rngintelt-rngintelt)
    - [`ControlledNot(~e, B, k): HilbSpcElt, {RngIntElt}, RngIntElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-controllednot-hilbspcelt-rngintelt-rngintelt-ref)
    - [`HadamardTrasformation(e): HilbSpcElt → HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#function-hadamardtrasformation-hilbspcelt)
    - [`HadamardTrasformation(~e): HilbSpcElt`](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#procedure-hadamardtrasformation-hilbspcelt-ref)
    - [Example: Unitary Transformations of a Quantum State](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/hilbert-space.md#example-ex-360d11)
- [Bibliography](https://docs.magma-maths.org/v2.30-1/CodingTheory/QuantumCodes/bibliography.md)
