Operator Space
MPSToolkit.jl includes a Pauli-basis operator-space layer for dynamics and open-system workflows.
Basis Helpers
The core basis and state helpers are:
pauli_siteindspauli_basis_statepauli_total_sz_statepauli_matricespauli_basispauli_components
The Pauli basis is the shared foundation for operator-space TEBD, DMT, Lindblad evolution, and DAOE-style projectors. In practice, a typical workflow is:
- build Pauli-basis site indices with
pauli_siteinds - prepare an operator-state
MPS - map local Hamiltonians or Lindbladians into Pauli-space gates
- run scheduled evolution or projection
Minimal Example
using MPSToolkit
using ITensors
using ITensorMPS
nsites = 6
sites = pauli_siteinds(nsites)
state = pauli_basis_state(sites, ["Z", "I", "I", "I", "I", "I"])
evolution = tebd_strang_evolution(
nsites,
0.05;
local_hamiltonian=(bond, weight) -> weight * spinhalf_tfim_bond_hamiltonian(nsites, bond; J=1.0, g=0.8),
map_hamiltonian=pauli_gate_from_hamiltonian,
maxdim=64,
cutoff=1e-12,
)
evolve!(state, evolution)The helper notebooks operatortebdhelper_apis.ipynb and dmt_scheduler.ipynb show the fuller scheduler-driven workflow.
Basis And Mapping API
MPSToolkit.pauli_siteinds — Function
pauli_siteinds(nsites; tagprefix="PauliSpace")Construct a vector of dimension-4 site indices suitable for vectorized local Pauli bases. The basis ordering is (I, X, Y, Z).
Arguments
nsites: Number of operator-space sites.
Keyword Arguments
tagprefix: Prefix used when naming the generatedIndextags.
Returns
- A vector of length
nsitescontaining dimension-4Indexobjects.
MPSToolkit.pauli_basis_state — Function
pauli_basis_state(sites, labels; coefficient=1.0)Build a Pauli-basis product MPS in the default local ordering (I, X, Y, Z). Each entry of labels may be an integer basis index or one of "I", "X", "Y", "Z" (or the corresponding symbols).
Arguments
sites: Pauli-space site indices, typically created bypauli_siteinds.labels: One local basis label per site.
Keyword Arguments
coefficient: Overall scalar prefactor stored on the first tensor.
Returns
- A product-state
MPSin operator space.
Examples
sites = pauli_siteinds(3)
rho = pauli_basis_state(sites, [:I, :Z, :I])MPSToolkit.pauli_total_sz_state — Function
pauli_total_sz_state(sites; coefficient=0.5)Build the Pauli-basis MPS representing coefficient * sum_j σ_j^z. With the default coefficient=0.5, this is the total spin operator ∑_j S_j^z.
Arguments
sites: Pauli-space site indices.
Keyword Arguments
coefficient: Scalar multiplying each localσ^zcontribution.
Returns
- An
MPSrepresentation of the summed operator in Pauli space.
Notes
- The returned state is not a simple product state; it uses bond dimension
2to encode the operator sum compactly.
MPSToolkit.pauli_matrices — Function
pauli_matrices(; include_identity=true)Return the dense spin-1/2 Pauli matrices.
Keyword Arguments
include_identity: Iftrue, include the identity matrix as fieldI.
Returns
- A named tuple whose fields follow the ordering
(I, X, Y, Z)when the identity is included, and(X, Y, Z)otherwise.
Examples
julia> pauli_matrices().Z
2x2 Matrix{ComplexF64}:
1+0im 0+0im
0+0im -1+0imMPSToolkit.pauli_basis — Function
pauli_basis(; include_identity=true)Return the spin-1/2 Pauli basis as labeled dense matrices.
Keyword Arguments
include_identity: Forwarded topauli_matrices.
Returns
- A vector of
Pair{Symbol, Matrix}entries in the same local ordering used throughout the operator-space code.
MPSToolkit.pauli_components — Function
pauli_components(operator; include_identity=true)Decompose a 2 x 2 operator into Pauli-basis coefficients.
Arguments
operator: Dense single-site operator matrix.
Keyword Arguments
include_identity: Iftrue, return the coefficient of the identity alongside the Pauli components.
Returns
- A named tuple of Hilbert-Schmidt coefficients, normalized so that
operator == sum(coeffs[name] * pauli_matrices()[name] for name in keys(coeffs)).
MPSToolkit.pauli_gate — Function
pauli_gate(unitary)Convert a dense physical unitary acting on spin-1/2 sites into the corresponding dense superoperator in the default local Pauli ordering (I, X, Y, Z).
Arguments
unitary: Dense physical-space unitary acting on one or more spin-1/2 sites.
Returns
- A dense matrix representing the induced operator-space map in the Pauli basis.
Notes
- Internally the map is built as
kron(conj(unitary), unitary)and then rotated into the normalized Pauli basis.
MPSToolkit.pauli_gate_from_hamiltonian — Function
pauli_gate_from_hamiltonian(h, dt)Build the Pauli-basis superoperator induced by a dense Hamiltonian over one time step.
Arguments
h: Dense physical-space Hamiltonian.dt: Real-time step.
Returns
- The operator-space gate corresponding to
exp(-im * dt * h).
MPSToolkit.pauli_lindblad_generator — Function
pauli_lindblad_generator(h, jumps)Build the dense Pauli-basis Lindbladian generator induced by the local Hamiltonian h and the local jump operators jumps. The local operator basis is assumed to be ordered as (I, X, Y, Z) on each spin-1/2 site.
Arguments
h: Dense Hamiltonian acting on one or more spin-1/2 sites.jumps: One jump operator or a collection of jump operators with the same dimension ash.
Returns
- A dense generator matrix in the normalized Pauli basis.
Notes
- The generator implements the standard Lindblad action
-im[H, ρ] + Σ_j (L_j ρ L_j† - 1/2 {L_j†L_j, ρ}).
MPSToolkit.pauli_gate_from_lindbladian — Function
pauli_gate_from_lindbladian(h, jumps, dt)Build the dense Pauli-basis TEBD gate generated by the local Lindbladian defined by h and jumps over one time step dt.
Arguments
h: Dense local Hamiltonian.jumps: Jump operator or collection of jump operators.dt: Time increment.
Returns
exp(dt * pauli_lindblad_generator(h, jumps)).
Local Operator And Lindblad Maps
The package exposes helpers for converting local Hamiltonians and Lindbladians into operator-space gates:
pauli_gatepauli_gate_from_hamiltonianpauli_lindblad_generatorpauli_gate_from_lindbladian
DMT And Projectors
Operator-space specific algorithms include:
dmt_step!dmt_evolve!DMTGateEvolutionpauli_daoe_projectorfdaoe_projector
These tools are intended for explicit operator-space workflows rather than as hidden internals.
Examples
For runnable examples, see Examples, especially the operator-space and open-system notebooks.