ITensor Reference
These APIs connect EDKit models and states with ITensor and Pauli-space workflows.
EDKit.vec2mps — Function
vec2mps(v::AbstractVector, s)Convert a state vector v into an MPS on the ITensor site indices s.
The vector is interpreted in EDKit's row-major site ordering convention, then reshaped into a tensor and wrapped as an MPS.
EDKit.mps2vec — Function
mps2vec(psi::MPS)Convert an MPS to a dense state vector.
Returns:
- A vector in EDKit's row-major site-order convention.
mps2vec(psi::MPS, B)Convert an MPS to coordinates in the symmetry-reduced basis B.
This routine is exact when psi already lies in the symmetry sector described by B. In that case it reconstructs the sector amplitudes from the amplitude on each representative product state together with the normalization/orbit data of B.
It is not a generic orthogonal projector for arbitrary MPS outside the sector: for a general state, use an explicit projection constructed from the basis if you need the true projected coefficients.
EDKit.mat2op — Function
Convert a matrix to an ITensor operator
Arguments:
mat: dense local operator matrix.s...: ITensor site indices describing the target Hilbert spaces.
Returns:
- An
ITensoroperator with bra/ket site structure compatible withop.
EDKit.op2mat — Function
Convert a ITensor operator to a matrix
Returns:
- The dense matrix representation of
oin the site ordering supplied bys....
EDKit.pbcmps — Function
pbcmps(sites, tensors)Construct an MPS from a list of tensor.
Arguments:
sites: physical site indices.tensors: local array data for a periodic-boundary-style construction.
Returns:
- An MPS normalized after summing over the boundary-sector contributions.
EDKit.productstate — Function
productstate(v::AbstractVector{<:Integer}, B::AbstractBasis)Construct the basis vector corresponding to the product configuration v.
v is a digit representation of local states in base B.B, for example [0, 1, 0, 1] for a spin-1/2 chain. The returned vector lives in the Hilbert space defined by B, so this works for tensor-product, projected, and symmetry-reduced bases alike.
productstate(s, states)
Return a product MPS
Arguments:
- s : Vector of indices
- states: Vector of vector representing local states
Returns:
- A product-state
MPSwith bond dimension1.
EDKit.pauli — Function
pauli(i, L=1)Return ith (size-L) Pauli matrices.
Arguments:
i: 1-based Pauli-string index in base-4 ordering.L: number of physical qubits/sites.
Returns:
- The dense matrix for the corresponding Pauli string.
pauli(Is::AbstractVector{<:Real})
Return a matrix from Pauli coefficients
Arguments:
Is: coefficient vector in the Pauli-product basis.
Returns:
- The dense operator reconstructed from those coefficients.
EDKit.pauli_list — Function
pauli_list(A)Return pauli components of a 2×2 matrix A.
More generally, A may act on n qubits as long as its dimension is 2^n.
Returns:
- The coefficient vector of
Ain the normalized Pauli-product basis.
EDKit.commutation_mat — Function
commutation_mat(L)Matrix representation for -i[H,⋅].
Returns:
- The Pauli-basis matrix of the commutator superoperator generated by
H.
EDKit.dissipation_mat — Function
dissipation_mat(L)Matrix representation for D[L].
Returns:
- The Pauli-basis matrix of the dissipator generated by jump operator
L.
EDKit.mps2pmps — Function
Convert a pure-state MPS to a Pauli-basis MPS representation of the corresponding operator-space object.
Arguments:
ψ: input MPS.S: Pauli site indices.
Returns:
- A Pauli-space
MPS.
EDKit.pmps2mpo — Function
pmps2mpo(ψ, s)Convert Pauli MPS to MPO.
EDKit.mpo2pmpo — Function
Convert MPO to Pauli MPO
Returns:
- The Pauli-basis MPO corresponding to the ordinary MPO
H.
EDKit.tebd_n! — Function
tebd_n!(ψ, G1, G2; cutoff=1e-14, maxdim=30)Apply one n-site TEBD sweep to ψ.
Arguments:
ψ: MPS to update in place.G1,G2: forward and backward gate layers.cutoff,maxdim: truncation controls passed tosvd.
Returns:
- The mutated and normalized
ψ.
This is a low-level routine intended for already-constructed gate sequences.
EDKit.tebd4 — Function
tebd4(h, s, τ)Construct a fourth-order Trotter gate sequence for local Hamiltonian terms h acting on the ITensor site indices s.
The output is a vector of ITensor gates that can be applied in order to perform one fourth-order TEBD time step of size τ.
Arguments:
h: local Hamiltonian matrices placed along the chain.s: ITensor site indices.τ: physical time step.
Returns:
- A vector of gate ITensors ordered according to the fourth-order decomposition.