From c151d395e6f7272bc04eca1c5b7c14e221bfff36 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 31 Dec 2023 22:20:20 +0000 Subject: [PATCH] build based on c4086aa --- dev/.documenter-siteinfo.json | 2 +- dev/API/index.html | 104 ++++++++++---------- dev/allops/index.html | 2 +- dev/canonicalization/200c18e3.png | Bin 0 -> 9404 bytes dev/canonicalization/56b3e651.png | Bin 0 -> 9498 bytes dev/canonicalization/a3bc7f87.png | Bin 0 -> 9486 bytes dev/canonicalization/bdb4fda5.png | Bin 0 -> 9584 bytes dev/canonicalization/index.html | 8 +- dev/commonstates/index.html | 2 +- dev/datastructures/index.html | 2 +- dev/ecc_example_sim/index.html | 8 +- dev/ghz4graph.png | Bin 3043 -> 6365 bytes dev/graphs/index.html | 2 +- dev/index.html | 2 +- dev/mixed/index.html | 2 +- dev/noise/index.html | 2 +- dev/noisycircuits/index.html | 2 +- dev/noisycircuits_API/index.html | 2 +- dev/noisycircuits_mc/index.html | 4 +- dev/noisycircuits_ops/index.html | 2 +- dev/noisycircuits_perturb/index.html | 4 +- dev/plotting/1c868b17.png | Bin 21998 -> 0 bytes dev/plotting/{88e7f7c5.svg => 1fdfddba.svg} | 12 +-- dev/plotting/4c4ee26a.png | Bin 0 -> 27330 bytes dev/plotting/{f8670ae6.svg => 74e7afa8.svg} | 12 +-- dev/plotting/{63d41778.svg => 9f417b0a.svg} | 12 +-- dev/plotting/{d38a9a51.svg => e68d2dc2.svg} | 12 +-- dev/plotting/{2a89fb94.svg => eab8b93a.svg} | 12 +-- dev/plotting/index.html | 22 ++--- dev/references/index.html | 2 +- dev/stab-algebra-manual/index.html | 2 +- dev/tutandpub/index.html | 2 +- 32 files changed, 119 insertions(+), 119 deletions(-) create mode 100644 dev/canonicalization/200c18e3.png create mode 100644 dev/canonicalization/56b3e651.png create mode 100644 dev/canonicalization/a3bc7f87.png create mode 100644 dev/canonicalization/bdb4fda5.png delete mode 100644 dev/plotting/1c868b17.png rename dev/plotting/{88e7f7c5.svg => 1fdfddba.svg} (99%) create mode 100644 dev/plotting/4c4ee26a.png rename dev/plotting/{f8670ae6.svg => 74e7afa8.svg} (98%) rename dev/plotting/{63d41778.svg => 9f417b0a.svg} (99%) rename dev/plotting/{d38a9a51.svg => e68d2dc2.svg} (98%) rename dev/plotting/{2a89fb94.svg => eab8b93a.svg} (98%) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 4dcbf5e84..82fdef053 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2023-12-30T07:34:44","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2023-12-31T22:20:14","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/API/index.html b/dev/API/index.html index 8c40efb6e..db1e13485 100644 --- a/dev/API/index.html +++ b/dev/API/index.html @@ -4,7 +4,7 @@ padding-top: 0 !important; padding-bottom: 0 !important; } -

States

Stabilizer states can be represented with the Stabilizer, Destabilizer, MixedStabilizer, and MixedDestabilizer tableau data structures. You probably want to use MixedDestabilizer which supports the widest set of operations.

Moreover, a MixedDestabilizer can be stored inside a Register together with a set of classical bits in which measurement results can be written.

Lastly, for Pauli frame simulations there is the PauliFrame type, a tableau in which each row represents a different Pauli frame.

There are convenience constructors for common types of states and operators.

Operations

Acting on quantum states can be performed either:

See the full list of operations for a list of implemented operations.

Autogenerated API list

QuantumClifford.QuantumCliffordModule

A module for using the Stabilizer formalism and simulating Clifford circuits.

source
QuantumClifford.continue_statConstant

Returned by applywstatus! if the circuit simulation should continue.

source
QuantumClifford.failure_statConstant

Returned by applywstatus! if the circuit reports a failure.

See also: VerifyOp, BellMeasurement.

source
QuantumClifford.false_success_statConstant

Returned by applywstatus! if the circuit reports a success, but it is a false positive (i.e., there was an undetected error).

See also: VerifyOp, BellMeasurement.

source
QuantumClifford.true_success_statConstant

Returned by applywstatus! if the circuit reports a success and there is no undetected error.

See also: VerifyOp, BellMeasurement.

source
QuantumClifford.AbstractSingleQubitOperatorType

Supertype of all single-qubit symbolic operators.

source
QuantumClifford.AbstractSymbolicOperatorType

Supertype of all symbolic operators. Subtype of AbstractCliffordOperator

source
QuantumClifford.AbstractTwoQubitOperatorType

Supertype of all two-qubit symbolic operators.

source
QuantumClifford.BellMeasurementType

A Bell measurement performing the correlation measurement corresponding to the given pauli projections on the qubits at the selected indices.

source
QuantumClifford.CircuitStatusType

A convenience struct to represent the status of a circuit simulated by mctrajectories

source
QuantumClifford.ClassicalXORType

Applies an XOR gate to classical bits. Currently only implemented for funcitonality with pauli frames.

source
QuantumClifford.CliffordOperatorType

Clifford Operator specified by the mapping of the basis generators.

julia> tCNOT
+

States

Stabilizer states can be represented with the Stabilizer, Destabilizer, MixedStabilizer, and MixedDestabilizer tableau data structures. You probably want to use MixedDestabilizer which supports the widest set of operations.

Moreover, a MixedDestabilizer can be stored inside a Register together with a set of classical bits in which measurement results can be written.

Lastly, for Pauli frame simulations there is the PauliFrame type, a tableau in which each row represents a different Pauli frame.

There are convenience constructors for common types of states and operators.

Operations

Acting on quantum states can be performed either:

  • In a "linear algebra" language where unitaries, measurements, and other operations have separate interfaces. This is an explicitly deterministic lower-level interface, which provides a great deal of control over how tableaux are manipulated. See the Stabilizer Tableau Algebra Manual as a primer on these approaches.
  • Or in a "circuit" language, where the operators (and measurements and noise) are represented as circuit gates. This is a higher-level interface in which the outcome of an operation can be stochastic. The API for it is centered around the apply! function. Particularly useful for Monte Carlo simulations and Perturbative Expansion Symbolic Results.

See the full list of operations for a list of implemented operations.

Autogenerated API list

QuantumClifford.BellMeasurementType

A Bell measurement performing the correlation measurement corresponding to the given pauli projections on the qubits at the selected indices.

source
QuantumClifford.CliffordOperatorType

Clifford Operator specified by the mapping of the basis generators.

julia> tCNOT
 X₁ ⟼ + XX
 X₂ ⟼ + _X
 Z₁ ⟼ + Z_
@@ -33,12 +33,12 @@
 
 julia> CliffordOperator(d)
 X₁ ⟼ + Z
-Z₁ ⟼ + Y
source
QuantumClifford.DestabilizerType

A tableau representation of a pure stabilizer state. The tableau tracks the destabilizers as well, for efficient projections. On initialization there are no checks that the provided state is indeed pure. This enables the use of this data structure for mixed stabilizer state, but a better choice would be to use MixedDestabilizer.

source
QuantumClifford.MixedDestabilizerType

A tableau representation for mixed stabilizer states that keeps track of the destabilizers in order to provide efficient projection operations.

The rank r of the n-qubit tableau is tracked, either so that it can be used to represent a mixed stabilizer state, or so that it can be used to represent an n-r logical-qubit code over n physical qubits. The "logical" operators are tracked as well.

When the constructor is called on an incomplete Stabilizer it automatically calculates the destabilizers and logical operators, following chapter 4 of (Gottesman, 1997). Under the hood the conversion uses the canonicalize_gott! canonicalization. That canonicalization permutes the columns of the tableau, but we automatically undo the column permutation in the preparation of a MixedDestabilizer so that qubits are not reindexed. The boolean keyword arguments undoperm and reportperm can be used to control this behavior and to report the permutations explicitly.

See also: stabilizerview, destabilizerview, logicalxview, logicalzview

source
QuantumClifford.PauliFrameType
struct PauliFrame{T, S} <: QuantumClifford.AbstractQCState

This is a wrapper around a tableau. This "frame" tableau is not to be viewed as a normal stabilizer tableau, although it does conjugate the same under Clifford operations. Each row in the tableau refers to a single frame. The row represents the Pauli operation by which the frame and the reference differ.

source
QuantumClifford.DestabilizerType

A tableau representation of a pure stabilizer state. The tableau tracks the destabilizers as well, for efficient projections. On initialization there are no checks that the provided state is indeed pure. This enables the use of this data structure for mixed stabilizer state, but a better choice would be to use MixedDestabilizer.

source
QuantumClifford.MixedDestabilizerType

A tableau representation for mixed stabilizer states that keeps track of the destabilizers in order to provide efficient projection operations.

The rank r of the n-qubit tableau is tracked, either so that it can be used to represent a mixed stabilizer state, or so that it can be used to represent an n-r logical-qubit code over n physical qubits. The "logical" operators are tracked as well.

When the constructor is called on an incomplete Stabilizer it automatically calculates the destabilizers and logical operators, following chapter 4 of (Gottesman, 1997). Under the hood the conversion uses the canonicalize_gott! canonicalization. That canonicalization permutes the columns of the tableau, but we automatically undo the column permutation in the preparation of a MixedDestabilizer so that qubits are not reindexed. The boolean keyword arguments undoperm and reportperm can be used to control this behavior and to report the permutations explicitly.

See also: stabilizerview, destabilizerview, logicalxview, logicalzview

source
QuantumClifford.PauliFrameType
struct PauliFrame{T, S} <: QuantumClifford.AbstractQCState

This is a wrapper around a tableau. This "frame" tableau is not to be viewed as a normal stabilizer tableau, although it does conjugate the same under Clifford operations. Each row in the tableau refers to a single frame. The row represents the Pauli operation by which the frame and the reference differ.

source
QuantumClifford.PauliFrameMethod
PauliFrame(
     frames,
     qubits,
     measurements
 ) -> PauliFrame{Stabilizer{QuantumClifford.Tableau{Vector{UInt8}, LinearAlgebra.Adjoint{UInt64, Matrix{UInt64}}}}, Matrix{Bool}}
-

Prepare an empty set of Pauli frames with the given number of frames and qubits. Preallocates spaces for measurement number of measurements.

source
QuantumClifford.PauliOperatorType

A multi-qubit Pauli operator ($±\{1,i\}\{I,Z,X,Y\}^{\otimes n}$).

A Pauli can be constructed with the P custom string macro or by building up one through products and tensor products of smaller operators.

julia> pauli3 = P"-iXYZ"
+

Prepare an empty set of Pauli frames with the given number of frames and qubits. Preallocates spaces for measurement number of measurements.

source
QuantumClifford.PauliOperatorType

A multi-qubit Pauli operator ($±\{1,i\}\{I,Z,X,Y\}^{\otimes n}$).

A Pauli can be constructed with the P custom string macro or by building up one through products and tensor products of smaller operators.

julia> pauli3 = P"-iXYZ"
 -iXYZ
 
 julia> pauli4 = 1im * pauli3 ⊗ X
@@ -55,7 +55,7 @@
 (true, false)
 
 julia> p[1] = (true, true); p
-+ YYZ
source
QuantumClifford.RegisterType

A register, representing the state of a computer including both a tableaux and an array of classical bits (e.g. for storing measurement results)

source
QuantumClifford.ResetType

Reset the specified qubits to the given state.

Be careful, this operation implies first tracing out the qubits, which can lead to mixed states if these qubits were entangled with the rest of the system.

See also: sMRZ

source
QuantumClifford.SingleQubitOperatorType

A "symbolic" general single-qubit operator which permits faster multiplication than an operator expressed as an explicit tableau.

julia> op = SingleQubitOperator(2, true, true, true, false, true, true) # Tableau components and phases
++ YYZ
source
QuantumClifford.RegisterType

A register, representing the state of a computer including both a tableaux and an array of classical bits (e.g. for storing measurement results)

source
QuantumClifford.ResetType

Reset the specified qubits to the given state.

Be careful, this operation implies first tracing out the qubits, which can lead to mixed states if these qubits were entangled with the rest of the system.

See also: sMRZ

source
QuantumClifford.SingleQubitOperatorType

A "symbolic" general single-qubit operator which permits faster multiplication than an operator expressed as an explicit tableau.

julia> op = SingleQubitOperator(2, true, true, true, false, true, true) # Tableau components and phases
 SingleQubitOperator on qubit 2
 X₁ ⟼ - Y
 Z₁ ⟼ - X
@@ -76,7 +76,7 @@
 
 julia> CliffordOperator(op, 1, compact=true) # You can also extract just the non-trivial part of the tableau
 X₁ ⟼ - Y
-Z₁ ⟼ - X

See also: sHadamard, sPhase, sId1, sX, sY, sZ, CliffordOperator

Or simply consult subtypes(QuantumClifford.AbstractSingleQubitOperator) and subtypes(QuantumClifford.AbstractTwoQubitOperator) for a full list. You can think of the s prefix as "symbolic" or "sparse".

source
QuantumClifford.SparseGateType

A Clifford gate, applying the given cliff operator to the qubits at the selected indices.

apply!(state, cliff, indices) and apply!(state, SparseGate(cliff, indices)) give the same result.

source
QuantumClifford.StabMixtureType
mutable struct StabMixture{T, F}

Represents mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is a pure stabilizer state.

julia> StabMixture(S"-X")
+Z₁ ⟼ - X

See also: sHadamard, sPhase, sId1, sX, sY, sZ, CliffordOperator

Or simply consult subtypes(QuantumClifford.AbstractSingleQubitOperator) and subtypes(QuantumClifford.AbstractTwoQubitOperator) for a full list. You can think of the s prefix as "symbolic" or "sparse".

source
QuantumClifford.SparseGateType

A Clifford gate, applying the given cliff operator to the qubits at the selected indices.

apply!(state, cliff, indices) and apply!(state, SparseGate(cliff, indices)) give the same result.

source
QuantumClifford.StabMixtureType
mutable struct StabMixture{T, F}

Represents mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is a pure stabilizer state.

julia> StabMixture(S"-X")
 A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
 𝒟ℯ𝓈𝓉𝒶𝒷
 + Z
@@ -101,7 +101,7 @@
  0.0+0.353553im | + _ | + Z
  0.0-0.353553im | + Z | + _
  0.853553+0.0im | + _ | + _
- 0.146447+0.0im | + Z | + Z

See also: PauliChannel

source
QuantumClifford.StabilizerType

Stabilizer, i.e. a list of commuting multi-qubit Hermitian Pauli operators.

Instances can be created with the S custom string macro or as direct sum of other stabilizers.

Stabilizers and Destabilizers

In many cases you probably would prefer to use the MixedDestabilizer data structure, as it caries a lot of useful additional information, like tracking rank and destabilizer operators. Stabilizer has mostly a pedagogical value, and it is also used for slightly faster simulation of a particular subset of Clifford operations.

julia> s = S"XXX
+ 0.146447+0.0im | + Z | + Z

See also: PauliChannel

source
QuantumClifford.StabilizerType

Stabilizer, i.e. a list of commuting multi-qubit Hermitian Pauli operators.

Instances can be created with the S custom string macro or as direct sum of other stabilizers.

Stabilizers and Destabilizers

In many cases you probably would prefer to use the MixedDestabilizer data structure, as it caries a lot of useful additional information, like tracking rank and destabilizer operators. Stabilizer has mostly a pedagogical value, and it is also used for slightly faster simulation of a particular subset of Clifford operations.

julia> s = S"XXX
              ZZI
              IZZ"
 + XXX
@@ -134,7 +134,7 @@
 
 julia> s[1,1] = (true, false); s
 + X_
-+ __

There are no automatic checks for correctness (i.e. independence of all rows, commutativity of all rows, hermiticity of all rows). The rank (number of rows) is permitted to be less than the number of qubits (number of columns): canonilization, projection, etc. continue working in that case. To great extent this library uses the Stabilizer data structure simply as a tableau. This might be properly abstracted away in future versions.

See also: PauliOperator, canonicalize!

source
QuantumClifford.UnitaryPauliChannelType

A Pauli channel datastructure, mainly for use with StabMixture.

More convenient to use than PauliChannel when you know your Pauli channel is unitary.

julia> Tgate = UnitaryPauliChannel(
++ __

There are no automatic checks for correctness (i.e. independence of all rows, commutativity of all rows, hermiticity of all rows). The rank (number of rows) is permitted to be less than the number of qubits (number of columns): canonilization, projection, etc. continue working in that case. To great extent this library uses the Stabilizer data structure simply as a tableau. This might be properly abstracted away in future versions.

See also: PauliOperator, canonicalize!

source
QuantumClifford.UnitaryPauliChannelType

A Pauli channel datastructure, mainly for use with StabMixture.

More convenient to use than PauliChannel when you know your Pauli channel is unitary.

julia> Tgate = UnitaryPauliChannel(
            (I, Z),
            ((1+exp(im*π/4))/2, (1-exp(im*π/4))/2)
        )
@@ -149,7 +149,7 @@
  0.853553+0.0im | + _ | + _
  0.0+0.353553im | + _ | + Z
  0.0-0.353553im | + Z | + _
- 0.146447+0.0im | + Z | + Z
source
QuantumClifford.VerifyOpType

A "probe" to verify that the state of the qubits corresponds to a desired good_state, e.g. at the end of the execution of a circuit.

source
QuantumClifford.sMRZType

Measure a qubit in the Z basis and reset to the |0⟩ state.

It does not trace out the qubit!

As described below there is a difference between measuring the qubit (followed by setting it to a given known state) and "tracing out" the qubit. By reset here we mean "measuring and setting to a known state", not "tracing out".

julia> s = MixedDestabilizer(S"XXX ZZI IZZ") # |000⟩+|111⟩
+ 0.146447+0.0im | + Z | + Z
source
QuantumClifford.VerifyOpType

A "probe" to verify that the state of the qubits corresponds to a desired good_state, e.g. at the end of the execution of a circuit.

source
QuantumClifford.sMRZType

Measure a qubit in the Z basis and reset to the |0⟩ state.

It does not trace out the qubit!

As described below there is a difference between measuring the qubit (followed by setting it to a given known state) and "tracing out" the qubit. By reset here we mean "measuring and setting to a known state", not "tracing out".

julia> s = MixedDestabilizer(S"XXX ZZI IZZ") # |000⟩+|111⟩
 𝒟ℯ𝓈𝓉𝒶𝒷
 + Z__
 + _X_
@@ -199,7 +199,7 @@
 𝒮𝓉𝒶𝒷━
 + Z__
 - ZZ_
-- Z_Z

See also: Reset, sMZ

source
QuantumClifford.PauliErrorFunction

A convenient constructor for various types of Pauli errors, that can be used as circuit gates in simulations. Returns more specific types when necessary.

source
QuantumClifford.applybranchesFunction

Compute all possible new states after the application of the given operator. Reports the probability of each one of them. Deterministic (as it reports all branches of potentially random processes), part of the Perturbative Expansion interface.

source
QuantumClifford.applynoise!Function

A method modifying a given state by applying the corresponding noise model. It is non-deterministic, part of the Noise interface.

source
QuantumClifford.PauliErrorFunction

A convenient constructor for various types of Pauli errors, that can be used as circuit gates in simulations. Returns more specific types when necessary.

source
QuantumClifford.applybranchesFunction

Compute all possible new states after the application of the given operator. Reports the probability of each one of them. Deterministic (as it reports all branches of potentially random processes), part of the Perturbative Expansion interface.

source
QuantumClifford.applynoise!Function

A method modifying a given state by applying the corresponding noise model. It is non-deterministic, part of the Noise interface.

source
QuantumClifford.bellFunction

Prepare one or more Bell pairs (with optional phases).

julia> bell()
 + XX
 + ZZ
 
@@ -217,11 +217,11 @@
 - XX__
 + ZZ__
 - __XX
-- __ZZ
source
QuantumClifford.bigramMethod
bigram(
     state::QuantumClifford.AbstractStabilizer;
     clip
 ) -> Matrix{Int64}
-

Get the bigram of a tableau.

It is the list of endpoints of a tableau in the clipped gauge.

If clip=true (the default) the tableau is converted to the clipped gauge in-place before calculating the bigram. Otherwise, the clip gauge conversion is skipped (for cases where the input is already known to be in the correct gauge).

Introduced in (Nahum et al., 2017), with a more detailed explanation of the algorithm in (Li et al., 2019) and (Gullans et al., 2020).

See also: canonicalize_clip!

source
QuantumClifford.canonicalize!Method
canonicalize!(
+

Get the bigram of a tableau.

It is the list of endpoints of a tableau in the clipped gauge.

If clip=true (the default) the tableau is converted to the clipped gauge in-place before calculating the bigram. Otherwise, the clip gauge conversion is skipped (for cases where the input is already known to be in the correct gauge).

Introduced in (Nahum et al., 2017), with a more detailed explanation of the algorithm in (Li et al., 2019) and (Gullans et al., 2020).

See also: canonicalize_clip!

source
QuantumClifford.canonicalize_clip!Method
canonicalize_clip!(
     state::QuantumClifford.AbstractStabilizer;
     phases
 ) -> QuantumClifford.AbstractStabilizer
@@ -294,25 +294,25 @@
 + _XZX__
 - _ZYX_Z
 - __YZ_X
-- ____Z_

If phases=false is set, the canonicalization does not track the phases in the tableau, leading to a significant speedup.

Introduced in (Nahum et al., 2017), with a more detailed explanation of the algorithm in Appendix A of (Li et al., 2019)

See also: canonicalize!, canonicalize_rref!, canonicalize_gott!.

source
QuantumClifford.canonicalize_gott!Method

Inplace Gottesman canonicalization of a tableau.

This uses different canonical form from canonicalize!. It is used in the computation of the logical X and Z operators of a MixedDestabilizer.

It returns the (in place) modified state, the indices of the last pivot of both Gaussian elimination steps, and the permutations that have been used to put the X and Z tableaux in standard form.

Based on (Gottesman, 1997).

See also: canonicalize!, canonicalize_rref!

source
QuantumClifford.canonicalize_gott!Method

Inplace Gottesman canonicalization of a tableau.

This uses different canonical form from canonicalize!. It is used in the computation of the logical X and Z operators of a MixedDestabilizer.

It returns the (in place) modified state, the indices of the last pivot of both Gaussian elimination steps, and the permutations that have been used to put the X and Z tableaux in standard form.

Based on (Gottesman, 1997).

See also: canonicalize!, canonicalize_rref!

source
QuantumClifford.canonicalize_rref!Method
canonicalize_rref!(
     state::QuantumClifford.AbstractStabilizer,
     colindices;
     phases
 ) -> Tuple{QuantumClifford.AbstractStabilizer, Any}
-

Canonicalize a stabilizer (in place) along only some columns.

This uses different canonical form from canonicalize!. It also indexes in reverse in order to make its use in traceout! more efficient. Its use in traceout! is its main application.

It returns the (in place) modified state and the index of the last pivot.

Based on (Audenaert and Plenio, 2005).

See also: canonicalize!, canonicalize_gott!

source
QuantumClifford.commMethod

Check whether two operators commute.

0x0 if they commute, 0x1 if they anticommute.

julia> P"XX"*P"ZZ", P"ZZ"*P"XX"
+
source
QuantumClifford.commMethod

Check whether two operators commute.

0x0 if they commute, 0x1 if they anticommute.

julia> P"XX"*P"ZZ", P"ZZ"*P"XX"
 (- YY, - YY)
 
 julia> comm(P"ZZ", P"XX")
 0x00
 
 julia> comm(P"IZ", P"XX")
-0x01
source
QuantumClifford.compactify_circuitMethod

Convert a list of gates to a more optimized "sum type" format which permits faster dispatch.

Generally, this should be called on a circuit before it is used in a simulation.

source
QuantumClifford.fastcolumnFunction

Convert a tableau to a memory layout that is fast for column operations.

In this layout a column of the tableau is stored (mostly) contiguously in memory. Due to bitpacking, e.g., packing 64 bits into a single UInt64, the memory layout is not perfectly contiguous, but it is still optimal given that some bitwrangling is required to extract a given bit.

See also: fastrow

source
QuantumClifford.fastrowFunction

Convert a tableau to a memory layout that is fast for row operations.

In this layout a Pauli string (a row of the tableau) is stored contiguously in memory.

See also: fastrow

source
QuantumClifford.generate!Method

Generate a Pauli operator by using operators from a given the Stabilizer.

It assumes the stabilizer is already canonicalized. It modifies the Pauli operator in place, generating it in reverse, up to a phase. That phase is left in the modified operator, which should be the identity up to a phase. Returns the new operator and the list of indices denoting the elements of stabilizer that were used for the generation.

julia> ghz = S"XXXX
+0x01
source
QuantumClifford.compactify_circuitMethod

Convert a list of gates to a more optimized "sum type" format which permits faster dispatch.

Generally, this should be called on a circuit before it is used in a simulation.

source
QuantumClifford.fastcolumnFunction

Convert a tableau to a memory layout that is fast for column operations.

In this layout a column of the tableau is stored (mostly) contiguously in memory. Due to bitpacking, e.g., packing 64 bits into a single UInt64, the memory layout is not perfectly contiguous, but it is still optimal given that some bitwrangling is required to extract a given bit.

See also: fastrow

source
QuantumClifford.fastrowFunction

Convert a tableau to a memory layout that is fast for row operations.

In this layout a Pauli string (a row of the tableau) is stored contiguously in memory.

See also: fastrow

source
QuantumClifford.generate!Method

Generate a Pauli operator by using operators from a given the Stabilizer.

It assumes the stabilizer is already canonicalized. It modifies the Pauli operator in place, generating it in reverse, up to a phase. That phase is left in the modified operator, which should be the identity up to a phase. Returns the new operator and the list of indices denoting the elements of stabilizer that were used for the generation.

julia> ghz = S"XXXX
                ZZII
                IZZI
                IIZZ";
@@ -329,7 +329,7 @@
 true
 
 julia> generate!(P"XII",canonicalize!(S"XII")) === nothing
-false
source
QuantumClifford.ghzFunction

Prepare a GHZ state of n qubits.

julia> ghz()
 + XXX
 + ZZ_
 + _ZZ
@@ -342,7 +342,7 @@
 + XXXX
 + ZZ__
 + _ZZ_
-+ __ZZ
source
QuantumClifford.graphstateMethod

Convert any stabilizer state to a graph state

Graph states are a special type of entangled stabilizer states that can be represented by a graph. For a graph $G=(V,E)$ the corresponding stabilizers are $S_v = X_v \prod_{u ∈ N(v)} Z_u$. Notice that such tableau rows contain only a single X operator. There is a set of single qubit gates that converts any stabilizer state to a graph state.

This function returns the graph state corresponding to a stabilizer and the gates that might be necessary to convert the stabilizer into a state representable as a graph.

For a tableau stab you can convert it with:

graph, hadamard_idx, iphase_idx, flips_idx = graphstate()

where graph is the graph representation of stab, and the rest specifies the single-qubit gates converting stab to graph: hadamard_idx are the qubits that require a Hadamard gate (mapping X ↔ Z), iphase_idx are (different) qubits that require an inverse Phase gate (Y → X), and flips_idx are the qubits that require a phase flip (Pauli Z gate), after the previous two sets of gates.

julia> using Graphs
+true

See also: graph_gatesequence

source
QuantumClifford.graphstateMethod

Convert any stabilizer state to a graph state

Graph states are a special type of entangled stabilizer states that can be represented by a graph. For a graph $G=(V,E)$ the corresponding stabilizers are $S_v = X_v \prod_{u ∈ N(v)} Z_u$. Notice that such tableau rows contain only a single X operator. There is a set of single qubit gates that converts any stabilizer state to a graph state.

This function returns the graph state corresponding to a stabilizer and the gates that might be necessary to convert the stabilizer into a state representable as a graph.

For a tableau stab you can convert it with:

graph, hadamard_idx, iphase_idx, flips_idx = graphstate()

where graph is the graph representation of stab, and the rest specifies the single-qubit gates converting stab to graph: hadamard_idx are the qubits that require a Hadamard gate (mapping X ↔ Z), iphase_idx are (different) qubits that require an inverse Phase gate (Y → X), and flips_idx are the qubits that require a phase flip (Pauli Z gate), after the previous two sets of gates.

julia> using Graphs
 
 julia> s = S" XXX
               ZZ_
@@ -406,32 +406,32 @@
 1-element Vector{Int64}:
  3

The Graphs.jl library provides many graph-theory tools and the MakieGraphs.jl library provides plotting utilies for graphs.

You can directly call the graph constructor on a stabilizer, if you just want the graph and do not care about the Clifford operation necessary to convert an arbitrary state to a state representable as a graph:

julia> collect(edges( Graph(bell()) ))
 1-element Vector{Graphs.SimpleGraphs.SimpleEdge{Int64}}:
- Edge 1 => 2

For a version that does not copy the stabilizer, but rather performs transformations in-place, use graphstate!. It would perform canonicalize_gott! on its argument as it finds a way to convert it to a graph state.

source
QuantumClifford.logdotMethod

Logarithm of the inner product between to Stabilizer states.

If the result is nothing, the dot inner product is zero. Otherwise the inner product is 2^(-logdot/2).

The actual inner product can be computed with LinearAlgebra.dot.

Based on (Garcia et al., 2012).

source
QuantumClifford.pfmeasurementsMethod
pfmeasurements(frame::PauliFrame) -> Any
-

Returns the measurement results for each frame in the PauliFrame instance.

Relative mesurements

The return measurements are relative to the reference measurements, i.e. they only say whether the reference measurements have been flipped in the given frame.

source
QuantumClifford.pfmeasurementsMethod
pfmeasurements(register::Register, frame::PauliFrame) -> Any
-

Takes the references measurements from the given Register and applies the flips as prescribed by the PauliFrame relative measurements. The result is the actual (non-relative) measurement results for each frame.

source
QuantumClifford.pftrajectoriesMethod
pftrajectories(
+ Edge 1 => 2

For a version that does not copy the stabilizer, but rather performs transformations in-place, use graphstate!. It would perform canonicalize_gott! on its argument as it finds a way to convert it to a graph state.

source
QuantumClifford.logdotMethod

Logarithm of the inner product between to Stabilizer states.

If the result is nothing, the dot inner product is zero. Otherwise the inner product is 2^(-logdot/2).

The actual inner product can be computed with LinearAlgebra.dot.

Based on (Garcia et al., 2012).

source
QuantumClifford.pfmeasurementsMethod
pfmeasurements(frame::PauliFrame) -> Any
+

Returns the measurement results for each frame in the PauliFrame instance.

Relative mesurements

The return measurements are relative to the reference measurements, i.e. they only say whether the reference measurements have been flipped in the given frame.

source
QuantumClifford.pfmeasurementsMethod
pfmeasurements(register::Register, frame::PauliFrame) -> Any
+

Takes the references measurements from the given Register and applies the flips as prescribed by the PauliFrame relative measurements. The result is the actual (non-relative) measurement results for each frame.

source
QuantumClifford.pftrajectoriesMethod
pftrajectories(
     circuit;
     trajectories,
     threads
 ) -> PauliFrame{Stabilizer{QuantumClifford.Tableau{Vector{UInt8}, LinearAlgebra.Adjoint{UInt64, Matrix{UInt64}}}}, Matrix{Bool}}
-

The main method for running Pauli frame simulations of circuits. See the other methods for lower level access.

Multithreading is enabled by default, but can be disabled by setting threads=false. Do not forget to launch Julia with multiple threads enabled, e.g. julia -t4, if you want to use multithreading.

See also: mctrajectories, petrajectories

source
QuantumClifford.pftrajectoriesMethod
pftrajectories(
+

The main method for running Pauli frame simulations of circuits. See the other methods for lower level access.

Multithreading is enabled by default, but can be disabled by setting threads=false. Do not forget to launch Julia with multiple threads enabled, e.g. julia -t4, if you want to use multithreading.

See also: mctrajectories, petrajectories

source
QuantumClifford.pftrajectoriesMethod
pftrajectories(
     register::Register,
     circuit;
     trajectories
 ) -> Tuple{Register, PauliFrame{Stabilizer{QuantumClifford.Tableau{Vector{UInt8}, LinearAlgebra.Adjoint{UInt64, Matrix{UInt64}}}}, Matrix{Bool}}}
-

For a given Register and circuit, simulates the reference circuit acting on the register and then also simulate numerous PauliFrame trajectories. Returns the register and the PauliFrame instance.

Use pfmeasurements to get the measurement results.

source
QuantumClifford.phasesMethod

The phases of a given tableau. It is a view, i.e. if you modify this array, the original tableau caries these changes.

source
QuantumClifford.prodphaseMethod

Get the phase of the product of two Pauli operators.

Phase is encoded as F(4) in the low qubits of an UInt8.

julia> P"ZZZ"*P"XXX"
+

For a given Register and circuit, simulates the reference circuit acting on the register and then also simulate numerous PauliFrame trajectories. Returns the register and the PauliFrame instance.

Use pfmeasurements to get the measurement results.

source
QuantumClifford.phasesMethod

The phases of a given tableau. It is a view, i.e. if you modify this array, the original tableau caries these changes.

source
QuantumClifford.prodphaseMethod

Get the phase of the product of two Pauli operators.

Phase is encoded as F(4) in the low qubits of an UInt8.

julia> P"ZZZ"*P"XXX"
 -iYYY
 
 julia> prodphase(P"ZZZ", P"XXX")
 0x03
 
 julia> prodphase(P"XXX", P"ZZZ")
-0x01
source
QuantumClifford.random_pauliMethod

A random Pauli operator on n qubits.

Use realphase=true to get operators with phase ±1 (excluding ±i). nophase=true sets the phase to +1.

Optionally, a "flip" probability p can be provided specified, in which case each bit is set to I with probability 1-p and to X, Y, or Z, each with probability p. Useful for simulating Pauli noise.

source
QuantumClifford.stabilizerplotFunction

A Makie.jl recipe for pictorial representation of a tableau.

Requires a Makie.jl backend to be loaded, e.g. using CairoMakie.

Alternatively, you can use the Plots.jl plotting ecosystem, e.g. using Plots; plot(S"XXX ZZZ").

Consult the documentation for more details on visualization options.

source
QuantumClifford.stabilizerplot_axisFunction

A Makie.jl recipe for pictorial representation of a tableau.

Requires a Makie.jl backend to be loaded, e.g. using CairoMakie.

Alternatively, you can use the Plots.jl plotting ecosystem, e.g. using Plots; plot(S"XXX ZZZ").

Consult the documentation for more details on visualization options.

source
QuantumClifford.random_pauliMethod

A random Pauli operator on n qubits.

Use realphase=true to get operators with phase ±1 (excluding ±i). nophase=true sets the phase to +1.

Optionally, a "flip" probability p can be provided specified, in which case each bit is set to I with probability 1-p and to X, Y, or Z, each with probability p. Useful for simulating Pauli noise.

source
QuantumClifford.stabilizerplotFunction

A Makie.jl recipe for pictorial representation of a tableau.

Requires a Makie.jl backend to be loaded, e.g. using CairoMakie.

Alternatively, you can use the Plots.jl plotting ecosystem, e.g. using Plots; plot(S"XXX ZZZ").

Consult the documentation for more details on visualization options.

source
QuantumClifford.stabilizerplot_axisFunction

A Makie.jl recipe for pictorial representation of a tableau.

Requires a Makie.jl backend to be loaded, e.g. using CairoMakie.

Alternatively, you can use the Plots.jl plotting ecosystem, e.g. using Plots; plot(S"XXX ZZZ").

Consult the documentation for more details on visualization options.

source
QuantumClifford.xbitMethod

Extract as a new bit array the X part of the UInt array of packed qubits of a given Pauli operator.

source
QuantumClifford.zbitMethod

Extract as a new bit array the Z part of the UInt array of packed qubits of a given Pauli operator.

source
QuantumInterface.apply!Function

In QuantumClifford the apply! function is used to apply any quantum operation to a stabilizer state, including unitary Clifford operations, Pauli measurements, and noise. Thus, this function may result in a random/stochastic result (e.g. with measurements or noise).

source
QuantumClifford.xbitMethod

Extract as a new bit array the X part of the UInt array of packed qubits of a given Pauli operator.

source
QuantumClifford.zbitMethod

Extract as a new bit array the Z part of the UInt array of packed qubits of a given Pauli operator.

source
QuantumInterface.apply!Function

In QuantumClifford the apply! function is used to apply any quantum operation to a stabilizer state, including unitary Clifford operations, Pauli measurements, and noise. Thus, this function may result in a random/stochastic result (e.g. with measurements or noise).

source
QuantumInterface.embedMethod

Embed a Pauli operator in a larger Pauli operator.

julia> embed(5, 3, P"-Y")
 - __Y__
 
 julia> embed(5, (3,5), P"-YX")
-- __Y_X
source
QuantumInterface.entanglement_entropyFunction

Get bipartite entanglement entropy of a subsystem

Defined as entropy of the reduced density matrix.

It can be calculated with multiple different algorithms, the most performant one depending on the particular case.

Currently implemented are the :clip (clipped gauge), :graph (graph state), and :rref (Gaussian elimination) algorithms. Benchmark your particular case to choose the best one.

source
QuantumInterface.entanglement_entropyMethod

Get bipartite entanglement entropy by first converting the state to a graph and computing the rank of the adjacency matrix.

Based on "Entanglement in graph states and its applications".

source
QuantumInterface.expectMethod
expect(p::PauliOperator, st::AbstractStabilizer)

Compute the expectation value of a Pauli operator p on a stabilizer state st. This function will allocate a temporary copy of the stabilizer state st.

source
QuantumInterface.entanglement_entropyFunction

Get bipartite entanglement entropy of a subsystem

Defined as entropy of the reduced density matrix.

It can be calculated with multiple different algorithms, the most performant one depending on the particular case.

Currently implemented are the :clip (clipped gauge), :graph (graph state), and :rref (Gaussian elimination) algorithms. Benchmark your particular case to choose the best one.

source
QuantumInterface.entanglement_entropyMethod

Get bipartite entanglement entropy by first converting the state to a graph and computing the rank of the adjacency matrix.

Based on "Entanglement in graph states and its applications".

source
QuantumInterface.expectMethod
expect(p::PauliOperator, st::AbstractStabilizer)

Compute the expectation value of a Pauli operator p on a stabilizer state st. This function will allocate a temporary copy of the stabilizer state st.

source
QuantumInterface.project!Method
project!(
     state::MixedStabilizer,
     pauli::PauliOperator;
     phases
@@ -556,47 +556,47 @@
 julia> project!(ms, P"IIY")[1]
 + X__
 + _Z_
-+ __Y

Similarly to project! on Stabilizer, this function has cubic complexity when the Pauli operator commutes with all rows of the tableau. Most of the time it is better to simply use MixedDestabilizer representation.

Unlike other project! methods, this one does not allow for keep_result=false, as the correct rank or anticommutation index can not be calculated without the expensive (cubic) canonicalization operation required by keep_result=true.

See the "Datastructure Choice" section in the documentation for more details.

See also: projectX!, projectY!, projectZ!.

source
QuantumInterface.reset_qubits!Method
reset_qubits!(
++ __Y

Similarly to project! on Stabilizer, this function has cubic complexity when the Pauli operator commutes with all rows of the tableau. Most of the time it is better to simply use MixedDestabilizer representation.

Unlike other project! methods, this one does not allow for keep_result=false, as the correct rank or anticommutation index can not be calculated without the expensive (cubic) canonicalization operation required by keep_result=true.

See the "Datastructure Choice" section in the documentation for more details.

See also: projectX!, projectY!, projectZ!.

source
QuantumInterface.reset_qubits!Method
reset_qubits!(
     s::Stabilizer,
     newstate,
     qubits;
     phases
 ) -> Any
-

Reset a given set of qubits to be in the state newstate. These qubits are traced out first, which could lead to "nonlocal" changes in the tableau.

source
QuantumInterface.traceout!Method
traceout!(
+

Reset a given set of qubits to be in the state newstate. These qubits are traced out first, which could lead to "nonlocal" changes in the tableau.

source

Private API

Private Implementation Details

These functions are used internally by the library and might be drastically modified or deleted without warning or deprecation.

QuantumClifford.TableauType

Internal Tableau type for storing a list of Pauli operators in a compact form. No special semantic meaning is attached to this type, it is just a convenient way to store a list of Pauli operators. E.g. it is not used to represent a stabilizer state, or a stabilizer group, or a Clifford circuit.

source

Private API

Private Implementation Details

These functions are used internally by the library and might be drastically modified or deleted without warning or deprecation.

QuantumClifford.TableauType

Internal Tableau type for storing a list of Pauli operators in a compact form. No special semantic meaning is attached to this type, it is just a convenient way to store a list of Pauli operators. E.g. it is not used to represent a stabilizer state, or a stabilizer group, or a Clifford circuit.

source
Base.invMethod
inv(
     c::CliffordOperator;
     phases
 ) -> CliffordOperator{QuantumClifford.Tableau{Vector{UInt8}, Matrix{UInt64}}}
-

Inverse of a CliffordOperator

source
QuantumClifford._remove_rowcol!Method

Unexported low-level function that removes a row (by shifting all rows up as necessary)

Because MixedDestabilizer is not mutable we return a new MixedDestabilizer with the same (modified) xzs array.

Used on its own, this function will break invariants. Meant to be used with projectremove!.

source
QuantumClifford._rowmove!Method

Unexported low-level function that moves row i to row j.

Used on its own, this function will break invariants. Meant to be used in _remove_rowcol!.

source
QuantumClifford.applynoise_branchesFunction

Compute all possible new states after the application of the given noise model. Reports the probability of each one of them. Deterministic (as it reports all branches of potentially random processes), part of the Noise interface.

source
QuantumClifford.initZ!Method
initZ!(frame::PauliFrame) -> PauliFrame
-

Inject random Z errors over all frames and qubits for the supplied PauliFrame with probability 0.5.

Calling this after initialization is essential for simulating any non-deterministic circuit. It is done automatically by most PauliFrame constructors.

source
QuantumClifford._remove_rowcol!Method

Unexported low-level function that removes a row (by shifting all rows up as necessary)

Because MixedDestabilizer is not mutable we return a new MixedDestabilizer with the same (modified) xzs array.

Used on its own, this function will break invariants. Meant to be used with projectremove!.

source
QuantumClifford._rowmove!Method

Unexported low-level function that moves row i to row j.

Used on its own, this function will break invariants. Meant to be used in _remove_rowcol!.

source
QuantumClifford.applynoise_branchesFunction

Compute all possible new states after the application of the given noise model. Reports the probability of each one of them. Deterministic (as it reports all branches of potentially random processes), part of the Noise interface.

source
QuantumClifford.initZ!Method
initZ!(frame::PauliFrame) -> PauliFrame
+

Inject random Z errors over all frames and qubits for the supplied PauliFrame with probability 0.5.

Calling this after initialization is essential for simulating any non-deterministic circuit. It is done automatically by most PauliFrame constructors.

source
QuantumClifford.make_sumtype_methodFunction

``` julia> makesumtypemethod([sCNOT], :apply!, (:s,)) quote function QuantumClifford.apply!(s, g::CompactifiedGate) @cases g begin sCNOT(q1, q2) => apply!(s, sCNOT(q1, q2)) end end end

source
QuantumClifford.make_sumtype_methodFunction

``` julia> makesumtypemethod([sCNOT], :apply!, (:s,)) quote function QuantumClifford.apply!(s, g::CompactifiedGate) @cases g begin sCNOT(q1, q2) => apply!(s, sCNOT(q1, q2)) end end end

source
QuantumClifford.projectremoverand!Method

Unexported low-level function that projects a qubit and returns the result while making the tableau smaller by a qubit.

Because MixedDestabilizer is not mutable we return a new MixedDestabilizer with the same (modified) xzs array.

source
QuantumClifford.remove_column!Method

Unexported low-level function that removes a column (by shifting all columns to the right of the target by one step to the left)

Because Tableau is not mutable we return a new Tableau with the same (modified) xzs array.

source
QuantumClifford.rowdecomposeMethod

Decompose a Pauli $P$ in terms of stabilizer and destabilizer rows from a given tableaux.

For given tableaux of rows destabilizer rows $\{d_i\}$ and stabilizer rows $\{s_i\}$, there are boolean vectors $b$ and $c$ such that $P = i^p \prod_i d_i^{b_i} \prod_i s_i^{c_i}$.

This function returns p, b, c.

julia> s = MixedDestabilizer(ghz(2))
+end)
source
QuantumClifford.projectremoverand!Method

Unexported low-level function that projects a qubit and returns the result while making the tableau smaller by a qubit.

Because MixedDestabilizer is not mutable we return a new MixedDestabilizer with the same (modified) xzs array.

source
QuantumClifford.remove_column!Method

Unexported low-level function that removes a column (by shifting all columns to the right of the target by one step to the left)

Because Tableau is not mutable we return a new Tableau with the same (modified) xzs array.

source
QuantumClifford.rowdecomposeMethod

Decompose a Pauli $P$ in terms of stabilizer and destabilizer rows from a given tableaux.

For given tableaux of rows destabilizer rows $\{d_i\}$ and stabilizer rows $\{s_i\}$, there are boolean vectors $b$ and $c$ such that $P = i^p \prod_i d_i^{b_i} \prod_i s_i^{c_i}$.

This function returns p, b, c.

julia> s = MixedDestabilizer(ghz(2))
 𝒟ℯ𝓈𝓉𝒶𝒷
 + Z_
 + _X
@@ -608,7 +608,7 @@
 (3, Bool[1, 0], Bool[1, 1])
 
 julia> im^3 * P"Z_" * P"XX" * P"ZZ"
-+ XY
source
QuantumClifford.to_cpuFunction

copies the memory content of the object to CPU

You can only use this function if CUDA.jl is imported

For more advanced users to_cpu(data, element_type) will reinterpret elements of data and converts them to element_type. For example based on your CPU architecture, if working with matrices of UInt32 is faster than UInt64, you can use to_cpu(data, UInt32)

julia> using QuantumClifford: to_cpu, to_gpu
++ XY
source
QuantumClifford.to_cpuFunction

copies the memory content of the object to CPU

You can only use this function if CUDA.jl is imported

For more advanced users to_cpu(data, element_type) will reinterpret elements of data and converts them to element_type. For example based on your CPU architecture, if working with matrices of UInt32 is faster than UInt64, you can use to_cpu(data, UInt32)

julia> using QuantumClifford: to_cpu, to_gpu
 
 julia> using CUDA # without this import, to_cpu, to_gpu are just function
 
@@ -631,7 +631,7 @@
 julia> pf_gpu = to_gpu(PauliFrame(1000, 2, 2));
 julia> circuit = [sMZ(1, 1), sHadamard(2), sMZ(2, 2)];
 julia> pftrajectories(pf_gpu, circuit);
-julia> measurements = to_cpu(pf_gpu.measurements);

See also: to_gpu

source
QuantumClifford.to_gpuFunction

copies the memory content of the object to GPU

You can only use this function if CUDA.jl is imported

For more advanced users to_gpu(data, element_type) will reinterpret elements of data and converts them to element_type. For example based on your GPU architecture, if working with matrices of UInt64 is faster than UInt32, you can use to_gpu(data, UInt64)

julia> using QuantumClifford: to_cpu, to_gpu
+julia> measurements = to_cpu(pf_gpu.measurements);

See also: to_gpu

source
QuantumClifford.to_gpuFunction

copies the memory content of the object to GPU

You can only use this function if CUDA.jl is imported

For more advanced users to_gpu(data, element_type) will reinterpret elements of data and converts them to element_type. For example based on your GPU architecture, if working with matrices of UInt64 is faster than UInt32, you can use to_gpu(data, UInt64)

julia> using QuantumClifford: to_cpu, to_gpu
 
 julia> using CUDA # without this import, to_cpu, to_gpu are just function
 
@@ -654,4 +654,4 @@
 julia> pf_gpu = to_gpu(PauliFrame(1000, 2, 2));
 julia> circuit = [sMZ(1, 1), sHadamard(2), sMZ(2, 2)];
 julia> pftrajectories(pf_gpu, circuit);
-julia> measurements = to_cpu(pf_gpu.measurements);

See also: to_cpu

source
+julia> measurements = to_cpu(pf_gpu.measurements);

See also: to_cpu

source
QuantumClifford.trusted_rankFunction

A "trusted" rank which returns rank(state) for Mixed[De]Stabilizer and lenght(state) for [De]Stabilizer.

source
QuantumClifford.zero!Method

Zero-out a given row of a Tableau

source
QuantumClifford.zero!Method

Zero-out the phases and single-qubit operators in a PauliOperator

source
QuantumClifford.@qubitop1Macro

Macro used to define single qubit symbolic gates and their qubit_kernel methods.

source
QuantumClifford.@qubitop2Macro

Macro used to define 2-qubit symbolic gates and their qubit_kernel methods.

source
QuantumClifford.@valbooldispatchMacro

Turns f(Val(x)) into x ? f(Val(true)) : f(Val(false)) in order to avoid dynamic dispatch

See discourse discussion

source
diff --git a/dev/allops/index.html b/dev/allops/index.html index 1c132656d..7ce95fd63 100644 --- a/dev/allops/index.html +++ b/dev/allops/index.html @@ -10,4 +10,4 @@ noise = UnbiasedUncorrelatedNoise(ε) noisy_gate = NoisyGate(SparseGate(tCNOT, [2,4]), noise)Example block output

In circuit diagrams the noise is not depicted, but after each application of the gate defined in noisy_gate, a noise operator will also be applied. The example above is of Pauli Depolarization implemented by UnbiasedUncorrelatedNoise.

One can also apply only the noise operator by using NoiseOp which acts only on specified qubits. Or alternatively, one can use NoiseOpAll in order to apply noise to all qubits.

[NoiseOp(noise, [4,5]), NoiseOpAll(noise)]
Example block output

The machinery behind noise processes and different types of noise is detailed in the section on noise

Coincidence Measurements

Global parity measurements involving single-qubit projections and classical communication are implemented with BellMeasurement. One needs to specify the axes of measurement and the qubits being measured. If the parity is trivial, the circuit continues, if the parity is non-trivial, the circuit ends and reports a detected failure. This operator is frequently used in the simulation of entanglement purification.

BellMeasurement([sMX(1), sMY(3), sMZ(4)])
Example block output

There is also NoisyBellMeasurement that takes the bit-flip probability of a single-qubit measurement as a third argument.

Stabilizer Measurements

A measurement over one or more qubits can also be performed, e.g., a direct stabilizer measurement on multiple qubits without the use of ancillary qubits. When applied to multiple qubits, this differs from BellMeasurement as it performs a single projection, unlike BellMeasurement which performs a separate projection for every single qubit involved. This measurement is implemented in PauliMeasurement which requires a Pauli operator on which to project and the index of the classical bit in which to store the result. Alternatively, there are sMX, sMZ, sMY if you are measuring a single qubit.

[PauliMeasurement(P"XYZ", 1), sMZ(2, 2)]
Example block output

Reset Operations

The Reset operations lets you trace out the specified qubits and set their state to a specific tableau.

new_state = random_stabilizer(3)
 qubit_indices = [1,2,3]
-Reset(new_state, qubit_indices)
Example block output

It can be done anywhere in a circuit, not just at the beginning.

+Reset(new_state, qubit_indices)Example block output

It can be done anywhere in a circuit, not just at the beginning.

diff --git a/dev/canonicalization/200c18e3.png b/dev/canonicalization/200c18e3.png new file mode 100644 index 0000000000000000000000000000000000000000..2cb61914f398b659cbc8de4038a372d1e2618190 GIT binary patch literal 9404 zcmeHNc{tQ-`yX*iGSn-lm@KVGmXlo!+MEcbB#}v*IT&NhGL}&^ofL|ZvM-IYOUiCU z8I&!{7{kb6Xe?O=W6aF^Or7^!@9+Bk{`y_#O@F+X%Qa)n%=doo=kxj8pZk8kcTZWG zLPexSAP@-j#IHxKArPS=2t+VkcpZ2JE{@0t59=?Rn;wPm_&;gY&tf4EdB};QCTIPV zrUtP0FW%sc&9;@qKaA;n+IUMOLa6 z{hCpiwrQ6<{@4Bc(>258v!t_4gt&^0VsYoWNXY54A@x5icK$Za{l%{5v#lqqzg5q$ zkTk63HXSqvPxWrSkz!cdnI1w!fS?*Rav1{P5s8x*fc=^vsP@QUk3h?bhTx8vmlWKlN=KNbqPk$v)ve!sbB}OBhzzN;sn>3lgIZcP zFYEeXvV}=Qd1_UKUbly4JDMf;k@oGkeQt~0D%cU3|J*3zQBqXHjbY5C3$WHv)zEZbtP*UFv(hsBsU%q;9Pln(XeR_>tY{(( zfowM04Adh0AOG=}aVwmVP7Px!ic);d#U!tptB=U>fK83@_%9ms`3gn8%MFPe>N%Ym-36H^t48J+v8rx`^_AqAd3Wr==UpL~lX)CysxhxYgg(m8r!xu4%Z2wT`xOIurC~ zuIC=_NZj6~j;72kBSE}5&gZKEq{ED7>n|c9fC5q`NCB1 zYWJt8x;++1`A#_bU(g)aGK5SD_$Dn)WM^k5Na9GQ%FbXJ&mGc3a2S5%4nrdrI?zk^ z$6NBqIP(lgm}-vp7BU1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eB9VK~X7eAf$c~5R8g~OK>l+xX&eV$&XP<>z!C51Xjg7g5HJG6S+)=w82og zglf(5A6cZEQv5Ay9Ar?Aw@i`?SsvmnQl|lV2f#HGQ=;7GNN9+L^K|u+V>O1kfE9;Afyo$j z_mxG4ksSk3fRo_cFDub22RQ}Odnh67DL)oHKHi$UI%dS*cfe~8CHmZZHQTUB_^r*C zMo(H=T4EIo@E@m_cr4Q9Fbf!YXlkZ( z?`IYLiM*EyvJt8h;UFC5cz5UEa>z`W+yR0Emcs;M<=lD1Bo<(!0*0=7f%gI*bMzay zVG%8u58kzUsWnNDfFBwfVx(#cRz}MUJ>CiUI8BImykMqB$DauSYpR(~o<2axJOAPj zigPLoqls()P%QJJH(NJX1eBDXV!BS7##xI2(R%psVHPQU80`H? ze|ns4D@g3cN?%YWr-AHIK^BQT&NRr!3Yi!JknD!hN7l}_84&^P`3j2n8jjSF1$hVj zdGPDzbsxg-sa7B-dh!YQ_iDt|v@o&#grtxahI5kVaiwdV6{ah>0Ob#VYzK7YLWK`Q z!ph*ZncXXw?q>i?Sqkg;w{7@Vrt((DITZLL<8?E_oDN6x?wa- z%5V1FHgsM;==Tuf#fNA^B&@J%u6dJcS=wDGr_t3ZG}a!hrr=_wnGz5-?C115T+Rf)8h}f4H4aJ} z?=lfCf^n8fMvkTK7nQDcWE|s--yt~wO_W<{zXL8pC=8-2r!K!$$l@In`J6+N4V+|+ zrKWPH%~i`sED%^KsuUEK-zozXLml7;MT#m{8CF<*-s-%$5_|Gx8&s!XT~l)bQ8Nj| ze}|l$8o_O_hU1;e?vIi=blt}cBH#OfSPV|(A2hAmvGLz`8%`HbfEGADVsz_(2{0&- N6UQu%7975G>z}Pl^g93m literal 0 HcmV?d00001 diff --git a/dev/canonicalization/56b3e651.png b/dev/canonicalization/56b3e651.png new file mode 100644 index 0000000000000000000000000000000000000000..66a14119393b09110b20fadd6cf6fb8e248d1a48 GIT binary patch literal 9498 zcmeHNc~sNawob(=DvH)ysRPF9s~U!)B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K-FmJ(o$`SAVAEWk!YlnmqrKNXnijWfIU6x^~L zkePI8J{2_u40f=$pz{+TUu?AgamG(7;#$o$8c~SOJ{3cclaM+Tmw@_xsjfIrn7dRW z%E!=r!mPHrsX%wTl>7AuHd|m2=UI`9+E$D8*~XtL&S}-EGM7JS$IATL)~UNpbL9(c zETczU6w1se229eqfS78q*R8gNDoW~A!cJRQiAS?+3{%r3G=)^G-Sf0xRI6&R>*uGS zR-l_VOGWk?gyk7VFU}h_G?eNloA9t2*Sx*&1$Zk|y0uDx7eojEDEB6sKLJhzD5l#V z^+Vgy7%5<~1C;k5%G#Ncvw#a~V^kHd)RZsOr60jcIv6ba_0A_+A<;8)BUbY8{@NJe z)d9)@P>#9O4BQeo6EE(p(ECc(V-th1F0Ydxi>xo+{10uQVXy!I literal 0 HcmV?d00001 diff --git a/dev/canonicalization/bdb4fda5.png b/dev/canonicalization/bdb4fda5.png new file mode 100644 index 0000000000000000000000000000000000000000..fb702f869f2f0cff652c0b428e216504e8ea4a58 GIT binary patch literal 9584 zcmeHNcT|)2zkU@5hys<06VXzQ5hN}^1i_+|3S|mJj0{1G5+F7xVJ0XjjtW`>$QCew z0tur5F(g4KpeRd5*h6H65%vff_nT1f?K!{y?&&rCd6V#d=JPzC&-cA&X>Pn> z-L`cQ1Z_C;(`jo6T9pGqQlZi-!4-XZr)=j&H!LtvosHRJD;s*L#ygwe1!x z42#t_x!D8R?MJ|nJ!^v~o}S*`-m4)fST9VI4$On96+*$!tW&p8BvST{B+FxQF^J~!UBPog@0QqnBN+y zI4(d4(K4f!1XOdk&5}mDoz99L%2n!lSW+Oi0afAxlkVjNj5kFmbuL*~hqku1E}kE7 z@@ZiTlZQ7Ayg5R#bGR$z$YoMA85J%q$%29`<_o1Vloa&);@f>+J=bjm0|T*LE0kz3 z@B|rWnbktZ!=sVzvhyU%v^>nh&pL1r@ zxzeN$l?M)ew9>tpLd(Y*E=}C8lHrG(ja01o5r;G%ve&fHxtKCFGT1*R0|_@u&i3l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-XnyqvUB5|0X=5FHd+~X`u08CkoETWz2H8tr)zXMznf~nNgbeWx&?EE z!i6!GW58HVg03l?1=@nvHA}9T3o+^gHCQy1@?dVPoz>i|rKRQb@eE9p{*8L*CN;YY zL9J=}`s&xdd$7co61@6V{lis1463GDn)nTqqN5N_ zg3nJZG*AVjo0$vc;62AQHJds+>6mVYckPM!N&`Wz!M@cL;BJ@!uXkyjMj=k!Mg;bj zsASzzpfI@XtLX`Ie=1u1QCMhUVIiEv$$+~LgX2u3_xG6w5VU%$=ve@e@W!(iK{NHn zK~bT8gEG5I49^vKwBndcouE#l9sP%a^Dzkt4op0s5wvvt_;IJ#m1Kqygj>L9J$4-vs*ZSPJabmv18=wHs zHR8nF8+rUSe}67Ojv(G-WrWVa)3id@t5fY5NOlmEZwpA^O`#VWy~IW`+eY95uXMhXgU7-9n^740d{;o66-Rj*Gg2^RFrj9Nl8h5 zt$zEAd);rMJl|I%?<4I1bpudVhn1GOtQX?4sQK)bbM@-NNibU)d3g(jpGwE?%a@!_&)3p@)`~d(G4>T zhV3i92Tz2^_Odf6_)qs>CUBM$fiDA#w=^m00q9UXQEFWkbpTaSQL(K{Ua48YUjnCr zOQ5VHt?%5qqd%7$0oqXXfXTHw{*bZ3@rkfhP_^*}{7R%(@nnTIeb|gdR3pFogk*AU zU6^{25`yajqljtn4Z{NyUolpdEZeYRkZyy^?5_1@WT z0!J_wKBeo=!i5LbcY}}0@ix&!?qQhxIkEhE2w_F%-Ol%D0Nx4nwC+f2GQc@S3%$u& z1`Z&2VK;tBp0H5n*%Qs3jfTO~|S=x9vlS$0O^SQ<dDgF7^?2TieP6?!CUYok^~Canonicalization · QuantumClifford.jl

Canonicalization operations

Different types of canonicalization operations are implemented. All of them are types of Gaussian elimination.

canonicalize!

First do elimination on all X components and only then perform elimination on the Z components. Based on (Garcia et al., 2012). It is used in logdot for inner products of stabilizer states.

The final tableaux, if square should look like the following

If the tableaux is shorter than a square, the diagonals might not reach all the way to the right.

using QuantumClifford, CairoMakie
 f=Figure()
 stabilizerplot_axis(f[1,1], canonicalize!(random_stabilizer(20,30)))
-f
Example block output

canonicalize_rref!

Cycle between elimination on X and Z for each qubit. Particularly useful for tracing out qubits. Based on (Audenaert and Plenio, 2005). For convenience reasons, the canonicalization starts from the bottom row, and you can specify as a second argument which columns to be canonicalized (useful for tracing out arbitrary qubits, e.g., in traceout!).

The tableau canonicalization is done in recursive steps, each one of which results in something akin to one of these three options

using QuantumClifford, CairoMakie
+f
Example block output

canonicalize_rref!

Cycle between elimination on X and Z for each qubit. Particularly useful for tracing out qubits. Based on (Audenaert and Plenio, 2005). For convenience reasons, the canonicalization starts from the bottom row, and you can specify as a second argument which columns to be canonicalized (useful for tracing out arbitrary qubits, e.g., in traceout!).

The tableau canonicalization is done in recursive steps, each one of which results in something akin to one of these three options

using QuantumClifford, CairoMakie
 f=Figure()
 stabilizerplot_axis(f[1,1], canonicalize_rref!(random_stabilizer(20,30),1:30)[1])
-f
Example block output

canonicalize_gott!

First do elimination on all X components and only then perform elimination on the Z components, but without touching the qubits that were eliminated during the X pass. Unlike other canonicalization operations, qubit columns are reordered, providing for a straight diagonal in each block. Particularly useful as certain blocks of the new created matrix are related to logical operations of the corresponding code, e.g. computing the logical X and Z operators of a MixedDestabilizer. Based on (Gottesman, 1997).

A canonicalized tableau would look like the following (the right-most block does not exist for square tableaux).

using QuantumClifford, CairoMakie
+f
Example block output

canonicalize_gott!

First do elimination on all X components and only then perform elimination on the Z components, but without touching the qubits that were eliminated during the X pass. Unlike other canonicalization operations, qubit columns are reordered, providing for a straight diagonal in each block. Particularly useful as certain blocks of the new created matrix are related to logical operations of the corresponding code, e.g. computing the logical X and Z operators of a MixedDestabilizer. Based on (Gottesman, 1997).

A canonicalized tableau would look like the following (the right-most block does not exist for square tableaux).

using QuantumClifford, CairoMakie
 f=Figure()
 stabilizerplot_axis(f[1,1], canonicalize_gott!(random_stabilizer(30))[1])
-f
Example block output

canonicalize_clip!

Convert to the "clipped" gauge of a stabilizer state resulting in a "river" of non-identity operators around the diagonal.

using QuantumClifford, CairoMakie
+f
Example block output

canonicalize_clip!

Convert to the "clipped" gauge of a stabilizer state resulting in a "river" of non-identity operators around the diagonal.

using QuantumClifford, CairoMakie
 f=Figure()
 stabilizerplot_axis(f[1,1], canonicalize_clip!(random_stabilizer(30)))
-f
Example block output

The properties of the clipped gauge are:

  1. Each qubit is the left/right "endpoint" of exactly two stabilizer rows.
  2. For the same qubit the two endpoints are always different Pauli operators.

This canonicalization is used to derive the bigram a stabilizer state, which is also related to entanglement entropy in the state.

Introduced in (Nahum et al., 2017), with a more detailed explanation of the algorithm in Appendix A of (Li et al., 2019).

+fExample block output

The properties of the clipped gauge are:

  1. Each qubit is the left/right "endpoint" of exactly two stabilizer rows.
  2. For the same qubit the two endpoints are always different Pauli operators.

This canonicalization is used to derive the bigram a stabilizer state, which is also related to entanglement entropy in the state.

Introduced in (Nahum et al., 2017), with a more detailed explanation of the algorithm in Appendix A of (Li et al., 2019).

diff --git a/dev/commonstates/index.html b/dev/commonstates/index.html index 303fe7390..92b30caa6 100644 --- a/dev/commonstates/index.html +++ b/dev/commonstates/index.html @@ -72,4 +72,4 @@ + XXXX + ZZ__ + _ZZ_ -+ __ZZ ++ __ZZ diff --git a/dev/datastructures/index.html b/dev/datastructures/index.html index 3215eabd3..034543119 100644 --- a/dev/datastructures/index.html +++ b/dev/datastructures/index.html @@ -1,2 +1,2 @@ -Datastructure Choice · QuantumClifford.jl

Data Structures Options

Choosing Appropriate Tableau Data Structure

There are four different data structures used to represent stabilizer states. If you will never need projective measurements you probably would want to use Stabilizer. If you require projective measurements, but only on pure states, Destabilizer should be the appropriate data structure. If mixed stabilizer states are involved, MixedStabilizer would be necessary.

Stabilizer is simply a list of Pauli operators in a tableau form. As a data structure it does not enforce the requirements for a pure stabilizer state (the rows of the tableau do not necessarily commute, nor are they forced to be Hermitian; the tableau might be underdetermined, redundant, or contradictory). It is up to the user to ensure that the initial values in the tableau are meaningful and consistent.

canonicalize!, project!, and generate! can accept an under determined (mixed state) Stabilizer instance and operate correctly. canonicalize! can also accept a redundant Stabilizer (i.e. not all rows are independent), leaving as many identity rows at the bottom of the canonicalized tableau as the number of redundant stabilizers in the initial tableau.

canonicalize! takes $\mathcal{O}(n^3)$ steps. generate! expects a canonicalized input and then takes $\mathcal{O}(n^2)$ steps. project! takes $\mathcal{O}(n^3)$ for projecting on commuting operators due to the need to call canonicalize! and generate!. If the projections is on an anticommuting operator (or if keep_result=false) then it takes $\mathcal{O}(n^2)$ steps.

MixedStabilizer provides explicit tracking of the rank of the mixed state and works properly when the projection is on a commuting operator not in the stabilizer (see table below for details). Otherwise it has the same performance as Stabilizer.

The canonicalization can be made unnecessary if we track the destabilizer generators. There are two data structures capable of that.

Destabilizer stores both the destabilizer and stabilizer states. project! called on it never requires a stabilizer canonicalization, hence it runs in $\mathcal{O}(n^2)$. However, project! will raise an exception if you try to project on a commuting state that is not in the stabilizer as that would be an expensive $\mathcal{O}(n^3)$ operation.

MixedDestabilizer tracks both the destabilizer operators and the logical operators in addition to the stabilizer generators. It does not require canonicalization for measurements and its project! operations always takes $\mathcal{O}(n^2)$.

For the operation _, anticom_index, result = project!(...) we have the following behavior:

projectionStabilizerMixedStabilizerDestabilizerMixedDestabilizer
on anticommuting operator anticom_index>0 result===nothingcorrect result in $\mathcal{O}(n^2)$ stepssame as Stabilizersame as Stabilizersame as Stabilizer
on commuting operator in the stabilizer anticom_index==0 result!==nothing$\mathcal{O}(n^3)$; or $\mathcal{O}(n^2)$ if keep_result=false$\mathcal{O}(n^3)$$\mathcal{O}(n^2)$ if the state is pure, throws exception otherwise$\mathcal{O}(n^2)$
on commuting operator out of the stabilizer[1] anticom_index==rank result===nothing$\mathcal{O}(n^3)$, but the user needs to manually include the new operator to the stabilizer; or $\mathcal{O}(n^2)$ if keep_result=false but then result indistinguishable from cell above and anticom_index==0$\mathcal{O}(n^3)$ and rank goes up by onenot applicable if the state is pure, throws exception otherwise$\mathcal{O}(n^2)$ and rank goes up by one

Notice the results when the projection operator commutes with the state but is not generated by the stabilizers of the state (the last row of the table). In that case we have _, anticom_index, result = project!(...) where both anticom_index==rank and result===nothing, with rank being the new rank after projection, one more than the number of rows in the tableau before the measurement.

Bit Packing in Integers and Array Order

We do not use boolean arrays to store information about the qubits as this would be wasteful (7 out of 8 bits in the boolean would be unused). Instead, we use all 8 qubits in a byte and peform bitwise logical operations as necessary. Implementation details of the object in RAM can matter for performance. The library permits any of the standard UInt types to be used for packing the bits, and larger UInt types (like UInt64) are usually faster as they permit working on 64 qubits at a time (instead of 1 if we used a boolean, or 8 if we used a byte).

Moreover, how a tableau is stored in memory can affect performance, as a row-major storage usually permits more efficient use of the CPU cache (for the particular algorithms we use).

Both of these parameters are benchmarked (testing the application of a Pauli operator, which is an $\mathcal{O}(n^2)$ operation; and testing the canonicalization of a Stabilizer, which is an $\mathcal{O}(n^3)$ operation). Row-major UInt64 is the best performing and it is used by default in this library.

  • 1This can occur only if the state being projected is mixed. Both Stabilizer and Destabilizer can be used for mixed states by simply providing fewer stabilizer generators than qubits at initialization. This can be useful for low-level code that tries to avoid the extra memory cost of using MixedStabilizer and MixedDestabilizer but should be avoided otherwise. project! works correctly or raises an explicit warning on all 4 data structures.
+Datastructure Choice · QuantumClifford.jl

Data Structures Options

Choosing Appropriate Tableau Data Structure

There are four different data structures used to represent stabilizer states. If you will never need projective measurements you probably would want to use Stabilizer. If you require projective measurements, but only on pure states, Destabilizer should be the appropriate data structure. If mixed stabilizer states are involved, MixedStabilizer would be necessary.

Stabilizer is simply a list of Pauli operators in a tableau form. As a data structure it does not enforce the requirements for a pure stabilizer state (the rows of the tableau do not necessarily commute, nor are they forced to be Hermitian; the tableau might be underdetermined, redundant, or contradictory). It is up to the user to ensure that the initial values in the tableau are meaningful and consistent.

canonicalize!, project!, and generate! can accept an under determined (mixed state) Stabilizer instance and operate correctly. canonicalize! can also accept a redundant Stabilizer (i.e. not all rows are independent), leaving as many identity rows at the bottom of the canonicalized tableau as the number of redundant stabilizers in the initial tableau.

canonicalize! takes $\mathcal{O}(n^3)$ steps. generate! expects a canonicalized input and then takes $\mathcal{O}(n^2)$ steps. project! takes $\mathcal{O}(n^3)$ for projecting on commuting operators due to the need to call canonicalize! and generate!. If the projections is on an anticommuting operator (or if keep_result=false) then it takes $\mathcal{O}(n^2)$ steps.

MixedStabilizer provides explicit tracking of the rank of the mixed state and works properly when the projection is on a commuting operator not in the stabilizer (see table below for details). Otherwise it has the same performance as Stabilizer.

The canonicalization can be made unnecessary if we track the destabilizer generators. There are two data structures capable of that.

Destabilizer stores both the destabilizer and stabilizer states. project! called on it never requires a stabilizer canonicalization, hence it runs in $\mathcal{O}(n^2)$. However, project! will raise an exception if you try to project on a commuting state that is not in the stabilizer as that would be an expensive $\mathcal{O}(n^3)$ operation.

MixedDestabilizer tracks both the destabilizer operators and the logical operators in addition to the stabilizer generators. It does not require canonicalization for measurements and its project! operations always takes $\mathcal{O}(n^2)$.

For the operation _, anticom_index, result = project!(...) we have the following behavior:

projectionStabilizerMixedStabilizerDestabilizerMixedDestabilizer
on anticommuting operator anticom_index>0 result===nothingcorrect result in $\mathcal{O}(n^2)$ stepssame as Stabilizersame as Stabilizersame as Stabilizer
on commuting operator in the stabilizer anticom_index==0 result!==nothing$\mathcal{O}(n^3)$; or $\mathcal{O}(n^2)$ if keep_result=false$\mathcal{O}(n^3)$$\mathcal{O}(n^2)$ if the state is pure, throws exception otherwise$\mathcal{O}(n^2)$
on commuting operator out of the stabilizer[1] anticom_index==rank result===nothing$\mathcal{O}(n^3)$, but the user needs to manually include the new operator to the stabilizer; or $\mathcal{O}(n^2)$ if keep_result=false but then result indistinguishable from cell above and anticom_index==0$\mathcal{O}(n^3)$ and rank goes up by onenot applicable if the state is pure, throws exception otherwise$\mathcal{O}(n^2)$ and rank goes up by one

Notice the results when the projection operator commutes with the state but is not generated by the stabilizers of the state (the last row of the table). In that case we have _, anticom_index, result = project!(...) where both anticom_index==rank and result===nothing, with rank being the new rank after projection, one more than the number of rows in the tableau before the measurement.

Bit Packing in Integers and Array Order

We do not use boolean arrays to store information about the qubits as this would be wasteful (7 out of 8 bits in the boolean would be unused). Instead, we use all 8 qubits in a byte and peform bitwise logical operations as necessary. Implementation details of the object in RAM can matter for performance. The library permits any of the standard UInt types to be used for packing the bits, and larger UInt types (like UInt64) are usually faster as they permit working on 64 qubits at a time (instead of 1 if we used a boolean, or 8 if we used a byte).

Moreover, how a tableau is stored in memory can affect performance, as a row-major storage usually permits more efficient use of the CPU cache (for the particular algorithms we use).

Both of these parameters are benchmarked (testing the application of a Pauli operator, which is an $\mathcal{O}(n^2)$ operation; and testing the canonicalization of a Stabilizer, which is an $\mathcal{O}(n^3)$ operation). Row-major UInt64 is the best performing and it is used by default in this library.

  • 1This can occur only if the state being projected is mixed. Both Stabilizer and Destabilizer can be used for mixed states by simply providing fewer stabilizer generators than qubits at initialization. This can be useful for low-level code that tries to avoid the extra memory cost of using MixedStabilizer and MixedDestabilizer but should be avoided otherwise. project! works correctly or raises an explicit warning on all 4 data structures.
diff --git a/dev/ecc_example_sim/index.html b/dev/ecc_example_sim/index.html index d1c669a87..afbef7056 100644 --- a/dev/ecc_example_sim/index.html +++ b/dev/ecc_example_sim/index.html @@ -20,7 +20,7 @@ errors = [PauliError(i,errprob) for i in 1:code_n(code)] fullcircuit = [ecirc..., errors..., scirc...]Example block output

And running this noisy simulation:

frames = pftrajectories(fullcircuit; trajectories=nframes)
 pfmeasurements(frames)
4×6 Matrix{Bool}:
- 0  0  1  1  0  1
- 0  1  0  1  1  0
- 1  1  0  0  0  0
- 0  0  0  0  0  0
+ 0 0 0 0 0 0 + 0 1 1 0 1 1 + 0 0 0 0 0 0 + 0 0 0 0 0 0 diff --git a/dev/ghz4graph.png b/dev/ghz4graph.png index 12735620741b8264704963eea600944ea987efd9..1624c6d713f00dddf5ab6c32084b564d89e57ea2 100644 GIT binary patch literal 6365 zcmds6c|6qb_MbF^8hd5WlB5_*cGVbLh@uq6KC)Fr2x&w{sITl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m?fK+JbIe z-{(Yq{J5sqKY`uC=TDB07a5cl(M98$KE6mA1IwK-UGKJ>>PurC;4AU);Y0A&b{N|~ zb`mZN{SaeGR2>k)US6M1*lBooXojzNpL9bqJ^6A~Ju8#YvUj~*U3c>Hqdzol7?m@2 zmmO+|c~n&ubnzljAUK3V$%r+#^nQ6!QCVrf=HrpEy1MGuQ>n)6N`j}ZaaKyrv(Ke_ zdwASezb`!r=7|b!-Lq#@fy9vn1Jo!oWvwJy@A$Tm1$@AJ))55a!fPWV2yyBUyuZrz zO$&HWFRy#Lm(`I-zYnJg1cIq4Cq)*y_sC9M-kYH6+41q(=pUgVl!-(l29q3WW+_sP n-#}$MEQ

Graphs are represented with the Graphs.jl package and plotting can be done both in Plots.jl and Makie.jl (with GraphMakie).

++ _ZZX

Graphs are represented with the Graphs.jl package and plotting can be done both in Plots.jl and Makie.jl (with GraphMakie).

diff --git a/dev/index.html b/dev/index.html index 517947b0f..26f3edb88 100644 --- a/dev/index.html +++ b/dev/index.html @@ -15,4 +15,4 @@ julia> tCNOT * S"-XX +ZZ" - X_ -+ _Z

Circuit Simulation

The circuit simulation component of QuantumClifford.jl enables Monte Carlo (or symbolic) simulations of noisy Clifford circuits. It provides three main simulation methods: mctrajectories, pftrajectories, and petrajectories. These methods offer varying levels of efficiency, accuracy, and insight.

Monte Carlo Simulations with Stabilizer Tableaux (mctrajectories)

The mctrajectories method runs Monte Carlo simulations using a Stabilizer tableau representation for the quantum states.

Monte Carlo Simulations with Pauli Frames (pftrajectories)

The pftrajectories method runs Monte Carlo simulations of Pauli frames over a single reference Stabilizer tableau simulation. This approach is much more efficient but supports a smaller class of circuits.

Symbolic Depth-First Traversal of Quantum Trajectories (petrajectories)

The petrajectories method performs a depth-first traversal of the most probable quantum trajectories, providing a fixed-order approximation of the circuit's behavior. This approach gives symbolic expressions for various figures of merit instead of just a numeric value.

++ _Z

Circuit Simulation

The circuit simulation component of QuantumClifford.jl enables Monte Carlo (or symbolic) simulations of noisy Clifford circuits. It provides three main simulation methods: mctrajectories, pftrajectories, and petrajectories. These methods offer varying levels of efficiency, accuracy, and insight.

Monte Carlo Simulations with Stabilizer Tableaux (mctrajectories)

The mctrajectories method runs Monte Carlo simulations using a Stabilizer tableau representation for the quantum states.

Monte Carlo Simulations with Pauli Frames (pftrajectories)

The pftrajectories method runs Monte Carlo simulations of Pauli frames over a single reference Stabilizer tableau simulation. This approach is much more efficient but supports a smaller class of circuits.

Symbolic Depth-First Traversal of Quantum Trajectories (petrajectories)

The petrajectories method performs a depth-first traversal of the most probable quantum trajectories, providing a fixed-order approximation of the circuit's behavior. This approach gives symbolic expressions for various figures of merit instead of just a numeric value.

diff --git a/dev/mixed/index.html b/dev/mixed/index.html index a18220831..4d196e107 100644 --- a/dev/mixed/index.html +++ b/dev/mixed/index.html @@ -57,4 +57,4 @@ + XXX + ZZ_ 𝒵ₗ━━━ -+ Z_Z

Destabilizer and MixedStabilizer do not use any column swaps on instantiation as they do not track the logical operators.

++ Z_Z

Destabilizer and MixedStabilizer do not use any column swaps on instantiation as they do not track the logical operators.

diff --git a/dev/noise/index.html b/dev/noise/index.html index 58a9e32d3..82654e7a2 100644 --- a/dev/noise/index.html +++ b/dev/noise/index.html @@ -1,2 +1,2 @@ -Noise Processes · QuantumClifford.jl
+Noise Processes · QuantumClifford.jl
diff --git a/dev/noisycircuits/index.html b/dev/noisycircuits/index.html index d4911b92b..b1bd64d2c 100644 --- a/dev/noisycircuits/index.html +++ b/dev/noisycircuits/index.html @@ -1,2 +1,2 @@ -Simulation of Noisy Circuits · QuantumClifford.jl

Simulation of Noisy Clifford Circuits

Unstable

This is unfinished experimental functionality that will change significantly.

We have experimental support for simulation of noisy Clifford circuits which can be imported with using QuantumClifford.Experimental.NoisyCircuits.

Both Monte Carlo and Perturbative Expansion approaches are supported. When performing a perturbative expansion in the noise parameter, the expansion can optionally be performed symbolically, to arbitrary high orders.

Multiple notebooks with examples are also available. For instance, see this tutorial on entanglement purification for many examples.

+Simulation of Noisy Circuits · QuantumClifford.jl

Simulation of Noisy Clifford Circuits

Unstable

This is unfinished experimental functionality that will change significantly.

We have experimental support for simulation of noisy Clifford circuits which can be imported with using QuantumClifford.Experimental.NoisyCircuits.

Both Monte Carlo and Perturbative Expansion approaches are supported. When performing a perturbative expansion in the noise parameter, the expansion can optionally be performed symbolically, to arbitrary high orders.

Multiple notebooks with examples are also available. For instance, see this tutorial on entanglement purification for many examples.

diff --git a/dev/noisycircuits_API/index.html b/dev/noisycircuits_API/index.html index 540ea5992..12675b0b7 100644 --- a/dev/noisycircuits_API/index.html +++ b/dev/noisycircuits_API/index.html @@ -1,2 +1,2 @@ -API · QuantumClifford.jl

Full API (autogenerated)

Unstable

This is experimental functionality with an unstable API.

+API · QuantumClifford.jl

Full API (autogenerated)

Unstable

This is experimental functionality with an unstable API.

diff --git a/dev/noisycircuits_mc/index.html b/dev/noisycircuits_mc/index.html index da27010d5..9379ac8e7 100644 --- a/dev/noisycircuits_mc/index.html +++ b/dev/noisycircuits_mc/index.html @@ -17,5 +17,5 @@ circuit = [n,g1,g2,m,v]Example block output

And we can run a Monte Carlo simulation of that circuit with mctrajectories.

mctrajectories(initial_state, circuit, trajectories=500)
Dict{CircuitStatus, Float64} with 4 entries:
   true_success:CircuitStatus(1)  => 459.0
   continue:CircuitStatus(0)      => 0.0
-  failure:CircuitStatus(3)       => 18.0
-  false_success:CircuitStatus(2) => 23.0

For more examples, see the notebook comparing the Monte Carlo and Perturbative method or this tutorial on entanglement purification for many examples.

Interface for custom operations

If you want to create a custom gate type (e.g. calling it Operation), you need to definite the following methods.

applywstatus!(s::T, g::Operation)::Tuple{T,Symbol} where T is a tableaux type like Stabilizer or a Register. The Symbol is the status of the operation. Predefined statuses are kept in the registered_statuses list, but you can add more. Be sure to expand this list if you want the trajectory simulators using your custom statuses to output all trajectories.

There is also applynoise! which is convenient wait to create a noise model that can then be plugged into the NoisyGate struct, letting you reuse the predefined perfect gates and measurements. However, you can also just make up your own noise operator simply by implementing applywstatus! for it.

You can also consult the list of implemented operators.

+ false_success:CircuitStatus(2) => 23.0 + failure:CircuitStatus(3) => 18.0

For more examples, see the notebook comparing the Monte Carlo and Perturbative method or this tutorial on entanglement purification for many examples.

Interface for custom operations

If you want to create a custom gate type (e.g. calling it Operation), you need to definite the following methods.

applywstatus!(s::T, g::Operation)::Tuple{T,Symbol} where T is a tableaux type like Stabilizer or a Register. The Symbol is the status of the operation. Predefined statuses are kept in the registered_statuses list, but you can add more. Be sure to expand this list if you want the trajectory simulators using your custom statuses to output all trajectories.

There is also applynoise! which is convenient wait to create a noise model that can then be plugged into the NoisyGate struct, letting you reuse the predefined perfect gates and measurements. However, you can also just make up your own noise operator simply by implementing applywstatus! for it.

You can also consult the list of implemented operators.

diff --git a/dev/noisycircuits_ops/index.html b/dev/noisycircuits_ops/index.html index 8550740f1..503023ec7 100644 --- a/dev/noisycircuits_ops/index.html +++ b/dev/noisycircuits_ops/index.html @@ -10,4 +10,4 @@ gate3 = SparseGate(tSWAP, [1,3]) cg = ConditionalGate(gate1, gate2, 2) dg = DecisionGate([gate1,gate2,gate3], bit_register->1) # it will always perform gate1 -[sMX(4,1), sMZ(5,2), cg, dg]Example block output

TODO: Split ConditionalGate into quantum conditional and classical conditional

+[sMX(4,1), sMZ(5,2), cg, dg]Example block output

TODO: Split ConditionalGate into quantum conditional and classical conditional

diff --git a/dev/noisycircuits_perturb/index.html b/dev/noisycircuits_perturb/index.html index 44c69a1d2..c7f20d256 100644 --- a/dev/noisycircuits_perturb/index.html +++ b/dev/noisycircuits_perturb/index.html @@ -19,5 +19,5 @@ petrajectories(initial_state, circuit)
Dict{CircuitStatus, Float64} with 3 entries:
   true_success:CircuitStatus(1)  => 0.903546
-  failure:CircuitStatus(3)       => 0.0365069
-  false_success:CircuitStatus(2) => 0.0547604

For more examples, see the notebook comparing the Monte Carlo and Perturbative method or this tutorial on entanglement purification.

Symbolic expansions

The perturbative expansion method works with symbolic variables as well. One can use any of the symbolic libraries available in Julia and simply plug symbolic parameters in lieu of numeric parameters. A detailed example is available as a Jupyter notebook.

Interface for custom operations

If you want to create a custom gate type (e.g. calling it Operation), you need to definite the following methods.

applyop_branches!(s::T, g::Operation; max_order=1)::Vector{Tuple{T,Symbol,Real,Int}} where T is a tableaux type like Stabilizer or a Register. The Symbol is the status of the operation, the Real is the probability for that branch, and the Int is the order of that branch.

There is also applynoise_branches! which is convenient for use in NoisyGate, but you can also just make up your own noise operator simply by implementing applyop_branches! for it.

You can also consult the list of implemented operators.

+ false_success:CircuitStatus(2) => 0.0547604 + failure:CircuitStatus(3) => 0.0365069

For more examples, see the notebook comparing the Monte Carlo and Perturbative method or this tutorial on entanglement purification.

Symbolic expansions

The perturbative expansion method works with symbolic variables as well. One can use any of the symbolic libraries available in Julia and simply plug symbolic parameters in lieu of numeric parameters. A detailed example is available as a Jupyter notebook.

Interface for custom operations

If you want to create a custom gate type (e.g. calling it Operation), you need to definite the following methods.

applyop_branches!(s::T, g::Operation; max_order=1)::Vector{Tuple{T,Symbol,Real,Int}} where T is a tableaux type like Stabilizer or a Register. The Symbol is the status of the operation, the Real is the probability for that branch, and the Int is the order of that branch.

There is also applynoise_branches! which is convenient for use in NoisyGate, but you can also just make up your own noise operator simply by implementing applyop_branches! for it.

You can also consult the list of implemented operators.

diff --git a/dev/plotting/1c868b17.png b/dev/plotting/1c868b17.png deleted file mode 100644 index 05d579db61386ad30171b1c7f7bf3b23cafa9a3e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21998 zcmdSBWmH?+`Y+t>3RPOXc(Ksn1or~P6D+v91P|_QvEqebAxN>{P)czt?yf*X!EH{xm@DZ6uaA1pBXXBXoL#qGcm zxvb?3t~)i#=+2M~C3+2$y*J)0gHIx9We(mcJ3|>W9)mnTe%Sof{TONV=R2UdaArV0 z?T8sugeO5zAc$_2aHE^_kppDzww!eKN*a!1)G0kLLD9!CPrQxuYyZh#{^jS%t^?!l zlV?Y?YA5rP(>A3IZe{R(hwHP@*4Ebhw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7c5.svg b/dev/plotting/1fdfddba.svg similarity index 99% rename from dev/plotting/88e7f7c5.svg rename to dev/plotting/1fdfddba.svg index 5e3fa9b0f..6cee15c3c 100644 --- a/dev/plotting/88e7f7c5.svg +++ b/dev/plotting/1fdfddba.svg @@ -1,23 +1,23 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Visualizations · QuantumClifford.jl

Visualizations

Stabilizers have a plot recipe that can be used with Plots.jl or Makie.jl. It simply displays the corresponding parity check matrix (extracted with stab_to_gf2) as a bitmap image. Circuits can be visualized with Quantikz.jl.

Importing the aforementioned packages together with QuantumClifford is necessary to enable the plotting functionality (implemented as package extensions).

Plots.jl

In Plots.jl we have a simple recipe plot(s::Stabilizer; xzcomponents=...) where xzcomponents=:split plots the tableau heatmap in a wide form, X bits on the left, Z bits on the right; or xzcomponents=:together plots them overlapping, with different colors for I, X, Z, and Y.

using QuantumClifford, Plots
-plot(random_stabilizer(20,30), xzcomponents=:split)
Example block output
using QuantumClifford, Plots
-plot(canonicalize!(random_stabilizer(20,30)))
Example block output
using QuantumClifford, Plots
-plot(canonicalize_gott!(random_stabilizer(30))[1], xzcomponents=:split)
Example block output
using QuantumClifford, Plots
-plot(canonicalize_gott!(random_stabilizer(30))[1]; xzcomponents=:together)
Example block output
using QuantumClifford, Plots
-plot(canonicalize_rref!(random_stabilizer(20,30),1:30)[1]; xzcomponents=:together)
Example block output

Makie.jl

Makie's heatmap can be directly called on Stabilizer.

using QuantumClifford, CairoMakie
+plot(random_stabilizer(20,30), xzcomponents=:split)
Example block output
using QuantumClifford, Plots
+plot(canonicalize!(random_stabilizer(20,30)))
Example block output
using QuantumClifford, Plots
+plot(canonicalize_gott!(random_stabilizer(30))[1], xzcomponents=:split)
Example block output
using QuantumClifford, Plots
+plot(canonicalize_gott!(random_stabilizer(30))[1]; xzcomponents=:together)
Example block output
using QuantumClifford, Plots
+plot(canonicalize_rref!(random_stabilizer(20,30),1:30)[1]; xzcomponents=:together)
Example block output

Makie.jl

Makie's heatmap can be directly called on Stabilizer.

using QuantumClifford, CairoMakie
 s = S"IIXZ
       ZZIZ
       YYIZ
@@ -13,7 +13,7 @@
 f, ax, p = CairoMakie.heatmap(s)
 hidedecorations!(ax); hidespines!(ax); # remove ticks and spines
 ax.aspect = DataAspect(); # set a one-to-one aspect ratio
-f
Example block output

A full Makie recipe is available as well (supporting xzcomponents)

using QuantumClifford, CairoMakie
+f

A full Makie recipe is available as well (supporting xzcomponents)

using QuantumClifford, CairoMakie
 s = S"IIXZ
       ZZIZ
       YYIZ
@@ -22,7 +22,7 @@
 f, ax, p = stabilizerplot(s, xzcomponents=:together)
 hidedecorations!(ax); hidespines!(ax)
 ax.aspect = DataAspect()
-f
Example block output

You can easily add colorbars (and change the colormap) as well:

using QuantumClifford, CairoMakie
+f

You can easily add colorbars (and change the colormap) as well:

using QuantumClifford, CairoMakie
 fig = Figure()
 ax, p = stabilizerplot(fig[1, 1], s, colormap=cgrad(:heat, 4, categorical = true))
 hidedecorations!(ax)
@@ -34,7 +34,7 @@
 # set the aspect ratio of the layout
 colsize!(fig.layout, 1, Aspect(1, size(s,2)/size(s,1)))
 Colorbar(fig[1, 2], p, ticks = (0:3, ["I", "X", "Z", "Y"]))
-fig
Example block output

Or set a completely custom set of colors:

fig = Figure()
+fig
Example block output

Or set a completely custom set of colors:

fig = Figure()
 ax, p = stabilizerplot(fig[1, 1], s, colormap=cgrad([:lightgray,RGBf(1,0.4,0.4),RGBf(0.3,1,0.5),RGBf(0.4,0.4,1)], 4, categorical = true))
 hidedecorations!(ax)
 hidespines!(ax)
@@ -43,8 +43,8 @@
 ax.aspect = DataAspect()
 colsize!(fig.layout, 1, Aspect(1, size(s,2)/size(s,1)))
 Colorbar(fig[2, 1], p, ticks = (0:3, ["I", "X", "Z", "Y"]), vertical = false, flipaxis = false)
-fig
Example block output

You might have noticed, Makie recipes do not let you edit the axes or figure, rather they only permit you to set the plot content. Which is why we use hidedecorations!, hidesplines!, and DataAspect to further modify the plot. However, these defaults are also available in stabilizerplot_axis.

using QuantumClifford, CairoMakie
+fig
Example block output

You might have noticed, Makie recipes do not let you edit the axes or figure, rather they only permit you to set the plot content. Which is why we use hidedecorations!, hidesplines!, and DataAspect to further modify the plot. However, these defaults are also available in stabilizerplot_axis.

using QuantumClifford, CairoMakie
 f=Figure()
 stabilizerplot_axis(f[1,1],random_stabilizer(100))
-f
Example block output

Quantikz.jl

With the Quantikz library you can visualize gates or sequences of gates.

using QuantumClifford, Quantikz
-circuit = [sCNOT(1,2), SparseGate(random_clifford(4), [1,4,5,6]), sMZ(4)]
Example block output
+fExample block output

Quantikz.jl

With the Quantikz library you can visualize gates or sequences of gates.

using QuantumClifford, Quantikz
+circuit = [sCNOT(1,2), SparseGate(random_clifford(4), [1,4,5,6]), sMZ(4)]
Example block output diff --git a/dev/references/index.html b/dev/references/index.html index 16a816bcb..7c9d24180 100644 --- a/dev/references/index.html +++ b/dev/references/index.html @@ -1,2 +1,2 @@ -Suggested Readings & References · QuantumClifford.jl

Suggested reading

For the basis of the tableaux methods first read (Gottesman, 1998) followed by the more efficient approach described in (Aaronson and Gottesman, 2004).

The tableaux can be canonicalized (i.e. Gaussian elimination can be performed on them) in a number of different ways, and considering the different approaches provides useful insight. The following methods are implemented in this library:

For the use of these methods in error correction and the subtle overlap between the two fields consider these resources. They are also useful in defining some of the specific constraints in commutation between rows in the tableaux:

These publications describe the uniform sampling of random stabilizer states:

References

+Suggested Readings & References · QuantumClifford.jl

Suggested reading

For the basis of the tableaux methods first read (Gottesman, 1998) followed by the more efficient approach described in (Aaronson and Gottesman, 2004).

The tableaux can be canonicalized (i.e. Gaussian elimination can be performed on them) in a number of different ways, and considering the different approaches provides useful insight. The following methods are implemented in this library:

For the use of these methods in error correction and the subtle overlap between the two fields consider these resources. They are also useful in defining some of the specific constraints in commutation between rows in the tableaux:

These publications describe the uniform sampling of random stabilizer states:

References

diff --git a/dev/stab-algebra-manual/index.html b/dev/stab-algebra-manual/index.html index d12f12a4b..b856a9a6a 100644 --- a/dev/stab-algebra-manual/index.html +++ b/dev/stab-algebra-manual/index.html @@ -293,4 +293,4 @@ 𝒮𝓉𝒶𝒷━ + _ZX - _Z_ -- Z_X

Mixed States

Both the Stabilizer and Destabilizer structures have more general forms that enable work with mixed stabilizer states. They are the MixedStabilizer and MixedDestabilizer structures, described in Mixed States. More information that can be seen in the data structures page, which expands upon the algorithms available for each structure.

Random States and Circuits

random_clifford, random_stabilizer, and enumerate_cliffords can be used for the generation of random states.

+- Z_X

Mixed States

Both the Stabilizer and Destabilizer structures have more general forms that enable work with mixed stabilizer states. They are the MixedStabilizer and MixedDestabilizer structures, described in Mixed States. More information that can be seen in the data structures page, which expands upon the algorithms available for each structure.

Random States and Circuits

random_clifford, random_stabilizer, and enumerate_cliffords can be used for the generation of random states.

diff --git a/dev/tutandpub/index.html b/dev/tutandpub/index.html index 6d9f46804..8da032497 100644 --- a/dev/tutandpub/index.html +++ b/dev/tutandpub/index.html @@ -1,2 +1,2 @@ -Tutorials and Publications · QuantumClifford.jl
+Tutorials and Publications · QuantumClifford.jl