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
julia> sites = pauli_siteinds(3);
julia> rho = pauli_basis_state(sites, [:I, :Z, :I]);
julia> length(rho)
3MPSToolkit.pauli_total_sz_state — Function
pauli_total_sz_state(sites; coefficient=nothing)Build the Pauli-basis MPS representing the total spin operator ∑_j S_j^z. The local Pauli basis is normalized as σ / sqrt(2), so the default coefficient inserted for each single-Z string is 2^(N / 2 - 1) for N sites.
Arguments
sites: Pauli-space site indices.
Keyword Arguments
coefficient: Optional scalar coefficient inserted directly for each single-Zstring in the normalized Pauli-basisMPS.
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> Z = pauli_matrices().Z;
julia> Z == [1 0; 0 -1]
true
julia> keys(pauli_matrices(; include_identity=false))
(:X, :Y, :Z)MPSToolkit.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)).
Notes
- These coefficients are taken against the unnormalized basis
{I, X, Y, Z}. They are not the operator-space state amplitudes produced bypauli_basis_stateand the other operator-space helpers, which use the normalized basisσ / √2. The two conventions differ by a factor of(√2)^LoverLsites, so do not feedpauli_componentsoutput directly into the operator-space state constructors.
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
- The returned matrix entry
G[α_out, α_in]istr(P_{α_out}' * U * P_{α_in} * U'), whereP_αare the normalizedn-site Pauli basis operators produced by_pauli_basis_operators. This convention matchespauli_basis_state,pauli_siteinds, andpauli_lindblad_generator, so the resulting super-operator can be applied to a Pauli-basis MPS viatebd_evolve!consistently.
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
The DMT functions (dmt_step!, dmt_evolve!, DMTGateEvolution) implement a truncation scheme designed specifically for transport (e.g. spin or energy diffusion). Their truncation rule preserves the identity component at every bond — an assumption that holds for transport but not for arbitrary operator-space tasks. For general operator-space TEBD evolution, use LocalGateEvolution with the Pauli-basis helpers above.
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.