Types

Base.MatrixMethod
Base.Matrix(p::Pauli{N}) where N

Build dense matrix representation in standard basis

source
Base.MatrixMethod
Base.Matrix(ps::PauliSum{N}; T=ComplexF64) where N

Create a dense Matrix of type T in the standard basis

source
Base.MatrixMethod
Base.Matrix(p::PauliBasis{N}) where N

Build dense matrix representation in standard basis

source
Base.VectorMethod
Base.Vector(k::Union{Ket{N}, Bra{N}}; T=Int64) where N

Create dense vector representation in standard basis

source
PauliOperators.DyadBasisType

A basis for Dyad's, which is not closed under multiplication. Since the product of two arbitrary dyad's don't generally create another dyad (e.g., while |i><j| * |j><l| = |i><l|, most products create scalars: |i><j| * |k><l| = 0). As such the product of two DyadBasis objects is not a DyadBasis object, but a Dyad, which contains a scalar factor. This type is primarily used to provide a basis for linear combinations of Dyad's, e.g., DyadSum's.

source
PauliOperators.PauliType
Pauli{N}

is our basic type for representing Pauli operators acting on N. Assume we want to represent a Pauli string of the following form:

σ1 ⊗ σ2 ⊗ σ3 ⊗ ⋯ ⊗ σN,

where, σ ∈ {X, Y, Z, I}. To do this efficiently, we use the symplectic representation of the Pauli group, where we factor each Pauli into a product of X and Z operators:

σ = i^(3*(z+x)%2) Zᶻ Xˣ,

with z,x ∈ {0,1}. The phase factor comes from the fact that Z*X = iY. In this representation, any tensor product of Pauli's is represented as two binary strings, one for x and one for z, along with the associated phase accumulated from each site. The format is as follows:

i^θ   Z^z₁ ⋅ X^x₁ ⊗ Z^z₂ ⋅ X^x₂ ⊗ ⋯ ⊗ Z^zₙ ⋅ X^xₙ

Products of operators simply concatonate the left and right strings separately. For example, To create a Y operator, bits in the same locations in z and x should be on.

XYZIy = 11001|01101     where y = iY

Since we get a factor of i each time we create a Y operator, we need to keep track of this to cancel the phase θs, arising from the ZX factorization.

P₁⊗...⊗Pₙ = i^θs ⋅ z₁...|x₁...  where Pᵢ ∈ {I,X,Y,Z}.

similarly,

z₁...|x₁... = i^-θs ⋅ P₁⊗...⊗Pₙ

We use θs to denote the phase needed to make the Pauli operator Hermitian and positive, and we refer to this as the symplectic_phase, since it arises solely from the symplectic representation of the Pauli. However, this is not the only phase we need to worry about. Since various phases accumulate during Pauli multiplication, we allow a given Pauli to have an arbitrary global phase, θg, so that the Pauli type can be closed under multiplication. As such, our Pauli phases are defined according to the following:

Pauli{N}(s,z,x)  =  s ⋅ z₁...|x₁... 
                 =  s ⋅ i^-θs ⋅ P₁⊗...⊗Pₙ
                 =  coeff ⋅ P₁⊗...⊗Pₙ

PauliBasis{N}(z,x)  =  i^θs ⋅ z₁...|x₁... 
                        =  P₁⊗...⊗Pₙ

Phase definitions:

  • symplectic_phase: θs - phase needed to cancel the phase arising from the ZX factorized form: θs = θ-θg

Since we need to keep track of a phase for a Pauli, we might as well let it become a general scalar value for broader use. As such, Pauli.s is a arbitrary complex number.

source
PauliOperators.PauliMethod
Pauli(N::Integer; X=[], Y=[], Z=[])

constructor for creating PauliBoolVec by specifying the qubits where each X, Y, and Z gates exist

source
PauliOperators.PauliMethod
Pauli(str::String)

Create a Pauli from a string, e.g.,

a = Pauli("XXYZIZ")

This is convieniant for manual manipulations, but is not type-stable so will be slow.

source
PauliOperators.PauliBasisType
z::Int128
x::Int128

A positive, Hermitian Pauli, used as a basis for more general Pauli's (which can have a complex phase). These are primarily used to provide a basis for linear combinations of Paulis, e.g., PauliSum's.

PauliBasis{N}(z,x)  =  i^θs ⋅ z₁...|x₁... 
                        =  P₁⊗...⊗Pₙ

Phase definitions:

  • symplectic_phase: θs - phase needed to cancel the phase arising from the ZX factorized form: θs = θ-θg
source
PauliOperators.PauliSumType
PauliSum{N, T} = Dict{Tuple{Int128,Int128},T}

A collection of Paulis, joined by addition. This uses a Dict to store them, however, the specific use cases should probably dictate the container type, so this will probably be removed.

source