Gates
Cliffords
PauliPropagation.clifford_map — Constantclifford_mapGlobal dictionary of Clifford gates and their action on Pauli strings. Currently supported Clifford gates are :H, :X, :Y, :Z, :SX, :SY, :S (:SZ) , :CNOT, :CZ, :ZZpihalf, and:SWAP. If one indexes into the returned arrays with the integer that corresponds to the partial Pauli string, the returned tuple is(sign, partialpstr)wheresignis the sign change andpartialpstr` is the new partial Pauli string.
PauliPropagation.CliffordGate — TypePauliPropagation.CliffordGate — MethodCliffordGate(symbol::Symbol, qinds::Vector{Int})
CliffordGate(symbol::Symbol, qinds::Int)A Clifford gate with the name symbol acting on the qubits qinds. symbol needs to match any of the implemented Clifford gates in the global clifford_map. qinds can be a single integer, a vector of integers, or anything that transforms into a vector via vec(collect(qinds)).
PauliPropagation.composecliffordmaps — Methodcomposecliffordmaps(circuit::Vector{CliffordGate})Compose a circuit of Clifford gates into a single Clifford map. The length of the map is 4^nqwherenqis the maximum qubit index in the circuit. The resulting clifford map can be added to the globalclifford_mapwith a custom Clifford gate name. The maximum number of qubits is 4 due to current restrictions ofUInt8`. Even if all gates only act on one qubit, that qubit index will determine the dimensionality of the map.
PauliPropagation.createcliffordmap — Methodcreatecliffordmap(gate_relations::Dict)Create a Clifford gate map from a dictionary of gate relations which can then be pushed to the global clifford_map. gate_relations is a dictionary with pairs like (:X, :X) => (:Z, :X, -1), describing the action of the Clifford gate on symbols (including the sign change).
PauliPropagation.reset_clifford_map! — Methodreset_clifford_map!()Reset global clifford_map to the CLifford gate implemented by default.
PauliPropagation.transposecliffordmap — Methodtransposecliffordmap(map_array::Vector{Tuple{UInt8,Int}})Transpose the Clifford gate maparray so that the output map is the inverse of the input map. For example, transposecliffordmap(clifford_map[:H]) returns the map for the inverse of the Hadamard gate, which is the same map.
Pauli rotations
PauliPropagation.PauliRotationUnion — TypePauliRotationUnionUnion type for PauliRotation and MaskedPauliRotation, useful for functions which handle either agnostically.
PauliPropagation.MaskedPauliRotation — TypeMaskedPauliRotation(symbols::Vector{Symbol}, qinds::Vector{Int}, term::PauliStringType)A parametrized Pauli rotation gate acting on the qubits qinds with the Pauli string symbols. The term is the integer representation of the Pauli string with the correct integer type for the total number of qubits. This allows for faster application of the gate. See tomaskedpaulirotation for conversion from PauliRotation, which is the easiest way to construct a MaskedPauliRotation.
PauliPropagation.PauliRotation — MethodPauliRotation(symbols, qinds, theta)Constructor for a frozen PauliRotation generated by the Pauli string symbols acting on the qubits qinds, and with fixed parameter theta.
PauliPropagation.PauliRotation — MethodPauliRotation(symbols::Vector{Symbol}, qinds::Vector{Int})
PauliRotation(symbol::Symbol, qinds::Int)A parametrized Pauli rotation generated by the Pauli string symbols acting on the qubits qinds. For example PauliRotation(:X, 2) or PauliRotation([:X, :Y], [1, 2]).
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(frozen_gate::FrozenGate, nqubits::Integer)Transforms a FrozenGate with a PauliRotation to a MaskedPauliRotation which carries the integer representation of the gate generator.
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(fast_pauli_gate::MaskedPauliRotation, args...)Return the MaskedPauliRotation gate as is.
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(pauli_gate::PauliRotation, nqubits::Integer)Transforms a PauliRotation to a MaskedPauliRotation which carries the integer representation of the gate generator. This allows for significantly faster computation with the gate.
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(circ::Vector{Gate})Returns a circuit where PauliRotation gates are transformed to MaskedPauliRotation gates. This allows for significantly faster computation with the gate.
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(circ::Vector{Gate})Returns a circuit where PauliRotation gates are transformed to MaskedPauliRotation gates. This allows for significantly faster computation with the gate.
PauliPropagation._tomaskedpaulirotation — Method_tomaskedpaulirotation(pauli_gate::PauliRotation, ::TermType)Transforms a PauliRotation to a MaskedPauliRotation which carries the integer representation of the gate generator. This allows for significantly faster computation with the gate.
PauliPropagation.commutes — Methodcommutes(gate::MaskedPauliRotation, pstr::PauliStringType)Check if a MaskedPauliRotation commutes with an integer Pauli string.
PauliPropagation.commutes — Methodcommutes(gate::PauliRotationUnion, pstr)Check if a PauliRotation commutes with an integer Pauli string.
PauliPropagation.commutes — Methodcommutes(gate::PauliRotation, pstr::PauliString)Check if a PauliRotation commutes with a PauliString.
PauliPropagation.tomatrix — Methodtomatrix(gate::PauliRotation, theta)Compute the unitary matrix for the PauliRotation gate with parameter theta in the computational 0/1 basis. This is done by computing the matrix U = cos(θ/2) I - i sin(θ/2) P where P is the Pauli matrix corresponding to the symbols. The returned unitary is returned in Schrödinger picture form.
Frozen
PauliPropagation.FrozenGate — TypeFrozenGate(gate::ParametrizedGate, parameter::Number)A StaticGate that wraps a ParametrizedGate with a fixed parameter. These are used to fix the parameter of ParametrizedGate at the time of circuit construction. This can be convenient but might exclude this parameter from being, e.g., differentiated by external libraries.
PauliPropagation.freeze — Methodfreeze(gates, parameters)Returns a vector of Gates where ParametrizedGates are frozen with their parameters.
PauliPropagation.freeze — Methodfreeze(gate::ParametrizedGate, parameter::Number)Returns a FrozenGate wrapping the gate with the fixed parameter.
Noise
PauliPropagation.AmplitudeDampingNoise — TypeAmplitudeDampingNoise(qind::Int)An amplitude damping noise channel acting on the qubit at index qind. Damps X and Y Paulis by a factor of sqrt(1-gamma) and splits Z into and gamma * I and (1-gamma) * Z component (in the transposed Heisenberg picture).
PauliPropagation.AmplitudeDampingNoise — MethodAmplitudeDampingNoise(qind::Int, gamma::Real)A frozen amplitude damping noise channel acting on the qubit at index qind with noise strength gamma. Damps X and Y Paulis, and splits Z into and I and Z component (in the transposed Heisenberg picture).
PauliPropagation.DephasingNoise — TypeDephasingNoise(qind::Int)
DephasingNoise(qind::Int, p::Real)This is an alias for PauliZNoise. A dephasing noise channel acting on the qubit at index qind. Will damp X and Y Paulis equally by a factor of 1-p. If p is provided, this returns a frozen gate with that noise strength.
PauliPropagation.DepolarizingNoise — MethodDepolarizingNoise(qind::Int, p::Real)A frozen depolarizing noise channel acting on the qubit at index qind with noise strength p. Will damp X, Y, and Z Paulis equally by a factor of 1-p.
PauliPropagation.DepolarizingNoise — MethodDepolarizingNoise(qind::Int)A depolarizing noise channel acting on the qubit at index qind. Will damp X, Y, and Z Paulis equally by a factor of 1-p.
PauliPropagation.ParametrizedNoiseChannel — TypeAbstract type for parametrized noise channels
PauliPropagation.PauliNoise — TypeAbstract type for Pauli noise, i.e., noise that is diagonal in Pauli basis
PauliPropagation.PauliXDamping — MethodPauliXDamping(qind::Int, p::Real)A frozen Pauli-X noise damping acting on the qubit at index qind with noise strength p. Will damp X Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliXDamping — MethodPauliXDamping(qind::Int)A Pauli-X noise damping acting on the qubit at index qind. Will damp X Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliXNoise — MethodPauliXNoise(qind::Int, p::Real)A frozen Pauli-X noise channel acting on the qubit at index qind with noise strength p. Will damp Y and Z Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli X operator into the circuit with probability p/2.
PauliPropagation.PauliXNoise — MethodPauliXNoise(qind::Int)A Pauli-X noise channel acting on the qubit at index qind. Will damp Y and Z Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli X operator into the circuit with probability p/2.
PauliPropagation.PauliYDamping — MethodPauliYDamping(qind::Int, p::Real)A frozen Pauli-Y damping acting on the qubit at index qind with noise strength p. Will damp Y Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliYDamping — MethodPauliYDamping(qind::Int)A Pauli-Y noise damping acting on the qubit at index qind. Will damp Y Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliYNoise — MethodPauliYNoise(qind::Int, p::Real)A frozen Pauli-Y noise channel acting on the qubit at index qind with noise strength p. Will damp X and Z Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli Y operator into the circuit with probability p/2.
PauliPropagation.PauliYNoise — MethodPauliYNoise(qind::Int)A Pauli-Y noise channel acting on the qubit at index qind. Will damp X and Z Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli Y operator into the circuit with probability p/2.
PauliPropagation.PauliZDamping — MethodPauliZDamping(qind::Int, p::Real)A frozen Pauli-Z noise damping acting on the qubit at index qind with noise strength p. Will damp Z Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliZDamping — MethodPauliZDamping(qind::Int)A Pauli-Z noise damping acting on the qubit at index qind. Will damp Z Paulis by a factor of 1-p. This alone is not a valid quantum channel.
PauliPropagation.PauliZNoise — MethodPauliZNoise(qind::Int, p::Real)A frozen Pauli-Z noise channel acting on the qubit at index qind with noise strength p. Will damp X and Y Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli Z operator into the circuit with probability p/2.
PauliPropagation.PauliZNoise — MethodPauliZNoise(qind::Int)A Pauli-Z noise channel acting on the qubit at index qind. Will damp X and Y Paulis equally by a factor of 1-p. This corresponds to inserting a random Pauli Z operator with probability p/2.
Misc
PauliPropagation.TGate — MethodTGate(qind::Integer)Returns a T gate acting on qubit qind. It acts on qubit qind like a PauliRotation(:Z, qind) with angle π/4.
PauliPropagation.TransferMapGate — TypeTransferMapGate(transfer_map::Vector{Vector{Tuple{TermType,CoeffType}}}, qinds::Vector{Int})A non-parametrized StaticGate defined by a transfer map acting on the qubits qinds. Transfer maps can be constructed manually or generated via totransfermap().
PauliPropagation.TransferMapGate — MethodA constructor for TransferMapGate that accepts matrix representations in the 0/1 basis or the Pauli basis (a PTM).
PauliPropagation.tomatrix — Methodtomatrix(gate::TGate)Compute the unitary matrix for a TGate. The returned unitary is returned in Schrödinger picture form.