API Reference
Hilbert/Liouville wrapper model
Hilbert and Liouville are ProcessTensors space labels for wrapped ITensorMPS objects. MPS{Hilbert} and MPO{Hilbert} represent ordinary states and operators, while MPS{Liouville} and MPO{Liouville} represent vectorized density operators and superoperators.
The wrapped ITensorMPS object lives in .core. Most generic ITensorMPS operations act on .core and rewrap the result with the same Hilbert or Liouville label. Liouville wrappers may also store combiners, which record how Hilbert bra/ket site pairs were fused so that to_hilbert can reconstruct the original density MPO.
Use liouv_sites to create Liouville site indices. Reuse the exact same Index objects across to_liouville, liouvillian_mpo, systems, baths, and process-tensor instruments so ITensor contractions match by index identity. Process-tensor input legs are primed (plev = 1) and output legs are unprimed (plev = 0).
List of ITensorMPS functions exported by ProcessTensors
ProcessTensors exposes a compact root surface for ordinary Hilbert/Liouville workflows. These names are the shared ITensorMPS generics, extended with methods that act on wrappers and rewrap results when appropriate, preserving the Hilbert or Liouville space marker. Here is a list of ITensorMPS.jl functions that is available in ProcessTensors.jl:
siteinds, siteind, linkinds, linkind, linkdim, linkdims, maxlinkdim
apply, contract, add
random_mps, random_mpo, outer, projector
inner, dot, norm, expect, correlation_matrix, entropy, tr
OpSum, add!, opFor generic MPS/MPO algorithmic details and keyword arguments, refer to the ITensorMPS documentation.
Advanced tensor-network surgery
Canonical forms, truncation diagnostics, bond moves, sampling, and related technical operations are not defined by ProcessTensors. Use ITensorMPS directly, typically on native cores for such algorithms. for example,
import ITensorMPS
expanded_core = ITensorMPS.expand(state.core, operator.core; alg="global_krylov", ...)
ITensorMPS.orthogonalize!(expanded_core, 1)API Documentation
Space tags
ProcessTensors.Basis.Hilbert — Type
HilbertType tag for ordinary Hilbert-space tensor networks.
MPS{Hilbert} represents a state vector, and MPO{Hilbert} represents an operator or density matrix on physical site indices.
ProcessTensors.Basis.Liouville — Type
LiouvilleType tag for vectorized density matrices and superoperators.
Liouville-space site indices have local dimension $d^2$ for a Hilbert-space site of dimension $d$. They are used by to_liouville, to_hilbert, Liouvillian MPOs, instruments, and process-tensor contractions.
MPS and MPO wrappers
ProcessTensors.AbstractMPS — Type
AbstractMPS{S<:AbstractSpace}Abstract interface for ProcessTensors matrix-product wrappers.
S records whether the wrapped tensor network lives in Hilbert space or Liouville space.
ProcessTensors.MPS — Type
MPS{S<:AbstractSpace}Matrix-product-state wrapper around an ITensorMPS.MPS stored in .core.
MPS{Hilbert} represents a Hilbert-space state vector and is the default result of MPS(...) and random_mps. MPS{Liouville} represents a vectorized density matrix or Liouville-space state; it carries combiners that record how Hilbert bra/ket site pairs were fused into Liouville sites by to_liouville, so to_hilbert can reconstruct the density MPO.
Examples
ψ = random_mps(sites; linkdims=4) # MPS{Hilbert}
ρ = to_dm(ψ)
ρL = to_liouville(ρ; sites=liouv_sites(sites)) # MPS{Liouville}ProcessTensors.AbstractMPO — Type
AbstractMPO{S<:AbstractSpace}Abstract interface for ProcessTensors matrix-product-operator wrappers.
S distinguishes ordinary Hilbert-space operators from Liouville-space superoperators used in open-system and process-tensor contractions.
ProcessTensors.MPO — Type
MPO{S<:AbstractSpace}Matrix-product-operator wrapper around an ITensorMPS.MPO stored in .core.
MPO{Hilbert} represents an operator or density matrix on Hilbert-space site indices and is the default result of MPO(...). MPO{Liouville} represents a Liouville-space superoperator acting on vectorized density matrices. Liouville MPOs may carry combiners when constructed from fused Hilbert indices, matching the convention used by to_liouville and liouvillian_mpo.
Ordinary ProcessTensors network operations act on wrappers and preserve the Hilbert / Liouville space marker. For advanced ITensorMPS algorithms, operate on .core and rewrap.
Examples
ρ = to_dm(random_mps(sites))
ρL = to_liouville(ρ; sites=liouv_sites(sites)) # MPS{Liouville} from density MPOMPS/MPO constructors
ProcessTensors.random_mps — Function
random_mps(args...; kwargs...) -> MPS{Hilbert}Construct a random Hilbert-space MPS by forwarding to ITensorMPS.random_mps and wrapping the returned core.
Examples
s = siteinds("S=1/2", 6)
ψ = random_mps(s; linkdims=4)ProcessTensors.random_mpo — Function
random_mpo(sites; kwargs...) -> MPO{Hilbert}Construct a random Hilbert-space MPO by forwarding to ITensorMPS.random_mpo and wrapping the returned core.
Examples
s = siteinds("S=1/2", 4)
W = random_mpo(s)Hilbert/Liouville conversion
ProcessTensors.liouv_sites — Function
liouv_sites(physical_sites::AbstractVector{<:Index}) -> Vector{Index}Construct Liouville-space site indices from Hilbert-space site indices.
Each returned index has dimension $d^2$ for a physical site of dimension $d$ and carries the "Liouv" tag plus physical site-family metadata ("ptype=..."). Reuse the same objects across to_liouville, liouvillian_mpo, and process-tensor instruments.
Examples
s_L = liouv_sites(siteinds("S=1/2", 4))ProcessTensors.to_dm — Method
to_dm(ψ::AbstractMPS{Hilbert})
to_dm(ψs::AbstractVector{<:AbstractMPS{Hilbert}}; coeffs)Construct a Hilbert-space density MPO.
For one state, returns the pure density operator $|ψ⟩⟨ψ|$. For a vector of states, returns the classical mixture $∑ᵢ pᵢ |ψᵢ⟩⟨ψᵢ|$ with non-negative coeffs summing to one.
Examples
ψ1 = random_mps(sites)
ψ2 = random_mps(sites)
ρ_pure = to_dm(ψ1)
ρ_mixed = to_dm([ψ1, ψ2]; coeffs=[0.3, 0.7])ProcessTensors.to_dm — Method
to_dm(ψs::AbstractVector{<:AbstractMPS{Hilbert}}; coeffs)Construct the mixed Hilbert-space density MPO sum(coeffs[i] * |ψ_i><ψ_i| for i in eachindex(ψs)).
coeffs must be non-negative, have the same length as ψs, and sum to one.
ProcessTensors.to_liouville — Method
to_liouville(ρ::AbstractMPO{Hilbert}; sites=nothing)
to_liouville(ψ::AbstractMPS{Hilbert})Vectorize a Hilbert-space density operator into a Liouville-space MPS.
Each local Hilbert bra/ket pair is fused into one Liouville site of dimension $d^2$. When sites is provided, those exact Liouville indices are reused so density states, Liouvillian MPOs, instruments, and process-tensor legs contract by index identity.
Examples
s = siteinds("S=1/2", 4)
s_L = liouv_sites(s)
ρL = to_liouville(ρ; sites=s_L)ProcessTensors.to_liouville — Method
to_liouville(ψ::AbstractMPS{Hilbert})Convert a Hilbert-space pure state by forming to_dm(ψ) and vectorizing the resulting density MPO.
ProcessTensors.to_hilbert — Function
to_hilbert(ρ::AbstractMPS{Liouville})Unvectorize a Liouville-space density MPS into a Hilbert-space density MPO.
Uses the combiners stored on ρ to split each Liouville site back into the corresponding Hilbert bra/ket site pair.
Examples
ρ = to_hilbert(ρL)Liouvillian builders
OpSum_Liouville, MPO_Liouville, and liouvillian_propagator_itensor are deprecated aliases of liouvillian_opsum, liouvillian_mpo, and liouvillian_propagator. Prefer the new names; the aliases will be removed in a later 0.3+ release after the migration window.
ProcessTensors.liouvillian_opsum — Method
liouvillian_opsum(os_H::OpSum; jump_ops=Tuple{Number,String,Int}[])
liouvillian_opsum(os_H::OpSum, jump_ops)
liouvillian_opsum(os_H::OpSum, L::OpSum)
liouvillian_opsum(os_H::OpSum, Ls::AbstractVector{<:OpSum})Construct the Liouville-space OpSum superoperator $L$ for the master equation
\[\frac{d\rho}{dt} = -i[H,\rho] + \sum_k \gamma_k \, \mathcal{D}[L_k]\rho,\]
where $\mathcal{D}[L]\rho = L\rho L^\dagger - \tfrac{1}{2}\{L^\dagger L, \rho\}$ is the Lindblad dissipator.
The Hamiltonian part is encoded as the commutator superoperator $-i[H,\cdot] = -i(H\otimes I - I\otimes H^\top)$ on vectorized density matrices. Each tuple jump $(\gamma, \text{opname}, j)$ adds $\gamma\,\mathcal{D}[L_j]$ with $L_j = \text{op}(\text{opname}, j)$. For example, jump_ops=[(0.1, "S-", 1)] adds amplitude damping via $L = S_-$ at site 1 with rate $\gamma = 0.1$.
Jump operators may also be supplied as OpSums or vectors of OpSums.
Examples
H = OpSum()
H += 1.0, "Sz", 1
L = liouvillian_opsum(H; jump_ops=[(0.1, "S-", 1)])ProcessTensors.liouvillian_opsum — Method
liouvillian_opsum(os_H::OpSum, jump::Tuple{<:Number,<:AbstractString,<:Integer})Construct the Liouvillian OpSum using one tuple-form Lindblad jump operator such as (γ, "S-", 1).
ProcessTensors.liouvillian_opsum — Method
liouvillian_opsum(os_H::OpSum, jumps::AbstractVector{<:Tuple{<:Number,<:AbstractString,<:Integer}})Construct the Liouvillian OpSum using several tuple-form Lindblad jump operators.
ProcessTensors.liouvillian_opsum — Method
liouvillian_opsum(os_H::OpSum, L::OpSum)Construct the Liouvillian OpSum using one Lindblad jump operator written as an OpSum.
ProcessTensors.liouvillian_opsum — Method
liouvillian_opsum(os_H::OpSum, Ls::AbstractVector{<:OpSum})Construct the Liouvillian OpSum using several Lindblad jump operators written as OpSums.
ProcessTensors.liouvillian_mpo — Method
liouvillian_mpo(os_H::OpSum, sites::AbstractVector{<:Index}; jump_ops=Tuple{Number,String,Int}[], splitblocks=true)
liouvillian_mpo(os_H::OpSum, jump_ops, sites::AbstractVector{<:Index}; splitblocks=true)Construct a Liouville-space MPO from a Hamiltonian and Lindblad jump operators.
sites may be physical Hilbert-space sites or pre-created Liouville sites from liouv_sites. Reuse the same Liouville indices across to_liouville and process-tensor objects.
Examples
s_L = liouv_sites(sites)
L_mpo = liouvillian_mpo(H, s_L; jump_ops=[(0.1, "S-", 1)])ProcessTensors.liouvillian_mpo — Method
liouvillian_mpo(os_H::OpSum, jump_ops, sites::AbstractVector{<:Index}; splitblocks=true)Construct a Liouville-space MPO using supported tuple-form or OpSum Lindblad jump operators supplied positionally.
ProcessTensors.liouvillian_propagator — Function
liouvillian_propagator(os, sites, dt; alg=Exact(), jump_ops=[], liouville_form=false)Build the one-step Liouville propagator $U = \exp(dt \, L)$ as a single ITensor on sites.
When liouville_form=false, os is a physical Hamiltonian and L is built by liouvillian_opsum:
\[L = -i[H,\cdot] + \sum_k \gamma_k \, \mathcal{D}[L_k], \qquad \mathcal{D}[L]\rho = L\rho L^\dagger - \tfrac{1}{2}\{L^\dagger L, \rho\}.\]
Set liouville_form=true when os is already a Liouville OpSum.
alg selects how $\exp(dt\,L)$ is constructed:
Exact()(default): contractLto a dense superoperator matrix and compute $U = \exp(dt\,L)$ exactly. Suitable for small Liouville dimensions.Trotter{n}(): approximate $\exp(dt\,L) \approx \prod_j \exp(dt\,L_j)$ usingtrotter_gates(orders1,2, and evenn >= 4), then contract the gate list withpropagator_itensor_from_gates.
Leg convention: unprimed sites are ket/output legs; prime.(sites) are bra/input legs.
Process tensors
ProcessTensors.ProcessTensor — Type
ProcessTensorLiouville-space MPO wrapper for a single-coupling-site process tensor.
Stores the environment influence and one-step system Liouvillian propagation as an MPO{Liouville} core over time-ordered input/output legs. Fields system, environment, dt, nsteps, and coupling_site record the physical model. High-level APIs such as evaluate_process, evolve, and two_time_correlation_seq contract this object with instrument schedules.
Unknown property access delegates to .core, like MPO.
Examples
pt = build_process_tensor(system, coupling_site; dt=0.1, nsteps=8)
trajectory = evolve(pt, ρ0)ProcessTensors.Dense — Type
Dense()Dense joint-Liouville process-tensor builder for no-bath, single-mode, and small multimode environments.
ProcessTensors.input_sites — Function
input_sites(pt, k)Return the primed input process-tensor leg at time label k.
ProcessTensors.output_sites — Function
output_sites(pt, k)Return the unprimed output process-tensor leg at time label k.
ProcessTensors.coupling_times — Function
coupling_times(pt, step)Return (out_prev, in_curr), the output leg at step - 1 and input leg at step, used by two-leg instruments between adjacent process-tensor slabs.
ProcessTensors.coupling_sites — Function
coupling_sites(pt, step)Return (in_curr, out_prev), the legacy ordering of coupling_times.
ProcessTensors.default_schedule — Function
default_schedule(pt)Construct an InstrumentSeq whose ordinary evolve slots use IdentityOperation.
The returned schedule does not include an initial state or final trace-out. Add those explicitly, or use evolve / evaluate_process overloads that accept an initial state.
ProcessTensors.isfullycontracted — Function
isfullycontracted(pt, seq) -> BoolReturn true when the schedule closes every process-tensor leg, so evaluate_process returns a ComplexF64 scalar.
ProcessTensors.open_leg_info — Function
open_leg_info(pt, seq) -> NamedTupleReport which process-tensor legs the schedule claims, which remain open, and their dimensions.
Returns a named tuple with fields:
in_map,out_map,missing_in,missing_outfrom schedule coverage mapsopen_in,open_out: time labels owned by open bookkeeping instrumentsn_open_expected: expected number of uncontracted system legs after evaluationopen_dims: dimensions of those expected open legs (frompt)
ProcessTensors.build_process_tensor — Method
build_process_tensor(system, coupling_site; method=Dense(), environment=nothing,
dt, nsteps, alg=Exact(), sys_alg=Trotter{1}(),
progress=:auto, verbose=false)Build a single-coupling-site process tensor.
coupling_site is the Liouville-space system leg kept as the process-tensor input/output channel. Reuse the same Liouville index objects across the system, bath, and instruments so later contractions match by exact index identity.
method selects the process-tensor construction backend. The default Dense backend builds exact joint-Liouville cores for no-bath, single-mode, and small multimode environments.
alg selects how the joint bath(+coupling) slab is built. sys_alg selects the timestep sandwich order of free-system maps around that bath core (Trotter{1}() asymmetric $Q·M(Δt)$, Trotter{2}() symmetric $M(Δt/2)·Q·M(Δt/2)$).
System propagation is always embedded in each process-tensor slab. Insert additional unitary control maps with UnitaryPropagation rather than building a process tensor without system propagation.
progress provides live progress feedback on the terminal; verbose=true prints persistent structured @info records suitable for headless runs.
Examples
pt = build_process_tensor(system, coupling_site; dt=0.1, nsteps=8)
pt_sym = build_process_tensor(system, coupling_site; dt=0.1, nsteps=8, sys_alg=Trotter{2}())ProcessTensors.build_process_tensor — Method
build_process_tensor(system; method=Dense(), environment=nothing,
dt, nsteps, alg=Exact(), sys_alg=Trotter{1}(),
progress=:auto, verbose=false)Build a process tensor for a single-site system by using its only Liouville site as the coupling site.
ProcessTensors.evaluate_process — Method
evaluate_process(pt, rho0; kwargs...)Evaluate a process tensor from an initial state using the default instrument schedule.
ProcessTensors.evaluate_process — Method
evaluate_process(pt, seqs::AbstractVector{<:InstrumentSeq}; kwargs...) -> Vector{ComplexF64}Evaluate a batch of fully contracted instrument schedules and return one scalar per schedule.
ProcessTensors.evaluate_process — Method
evaluate_process(pt, rho0, seq; kwargs...)Insert state_preparation(rho0) at tstep = 0 and contract the resulting schedule with pt.
ProcessTensors.evaluate_process — Method
evaluate_process(pt, rho0; kwargs...)Evaluate a process tensor from an initial state using the default instrument schedule.
ProcessTensors.evolve — Method
evolve(pt, seq; default_instr=_schedule_default_instr(pt), alg=Trotter{2}(),
progress=:auto, verbose=false)Return reduced system snapshots generated by contracting a process tensor with an instrument schedule.
The result is a named tuple containing the sample times, Liouville-space states, and reconstructed Hilbert-space density MPOs.
Examples
trajectory = evolve(pt, ρ0)
ρ_t = trajectory.states_hilbert[3]ProcessTensors.evolve — Method
evolve(pt, rho0, seq; default_instr=_schedule_default_instr(pt))Insert state_preparation(rho0) at tstep = 0 and return reduced system snapshots for the resulting schedule.
ProcessTensors.evolve — Method
evolve(pt, rho0; default_instr=_schedule_default_instr(pt))Return reduced system snapshots from an initial state using the default instrument schedule.
ProcessTensors.two_time_correlation_seq — Function
two_time_correlation_seq(pt, (O_A, n_A), (O_B, n_B); rho0, default_instr)Build an InstrumentSeq for the two-time correlator $\langle A(t_A) B(t_B)\rangle$.
rho0 is prepared at tstep = 0, and operator insertions are placed on the process-tensor legs indexed by n_A and n_B.
Examples
seq = two_time_correlation_seq(pt, (O_A, 1), (O_B, 3); rho0=ρ0)
result = evaluate_process(pt, seq)Systems
ProcessTensors.AbstractSystem — Type
AbstractSystemAbstract interface for system models used in process-tensor construction.
Concrete systems store a Hamiltonian H, Lindblad jump operators jump_ops, and canonical Liouville-space sites for the system degrees of freedom.
ProcessTensors.SpinSystem — Type
SpinSystem(sites, H, jump_ops)Spin-system model for process-tensor construction.
sites may be either all Hilbert-space spin site indices or all Liouville-space spin indices. Hilbert sites are converted with liouv_sites; mixed Hilbert/Liouville inputs are rejected. H is a physical Hamiltonian OpSum, and jump_ops is a vector of Lindblad-channel OpSums.
ProcessTensors.BosonSystem — Type
BosonSystem(sites, H, jump_ops)Bosonic-system model for process-tensor construction.
sites may be either all Hilbert-space boson site indices or all Liouville-space boson indices. Hilbert sites are converted with liouv_sites; mixed Hilbert/Liouville inputs are rejected. H is a physical Hamiltonian OpSum, and jump_ops is a vector of Lindblad-channel OpSums.
ProcessTensors.spin_system — Function
spin_system(sites, H; jump_ops=OpSum[])Construct a SpinSystem using keyword-style Lindblad jump operators.
ProcessTensors.boson_system — Function
boson_system(sites, H; jump_ops=OpSum[])Construct a BosonSystem using keyword-style Lindblad jump operators.
Baths and spectral densities
ProcessTensors.Environments.AbstractBathMode — Type
AbstractBathModeAbstract interface for a single bath mode coupled to a system.
Concrete modes store an initial state rho0, a local Hamiltonian H, optional mode-system coupling, and Liouville-space sites.
ProcessTensors.Environments.BosonicMode — Type
BosonicMode(sites, H, n_max, rho0; coupling=OpSum())Single bosonic bath mode in Liouville space.
rho0 is the initial mode state and must have site indices exactly equal to sites. H is the local mode Hamiltonian. coupling uses local site labels with site 1 for the bath mode and site 2 for the coupled system site.
Prefer bosonic_mode for inferred n_max and keyword-only construction.
ProcessTensors.Environments.SpinMode — Type
SpinMode(sites, H, rho0; coupling=OpSum())Single spin bath mode in Liouville space.
rho0 is the initial mode state and must have site indices exactly equal to sites. H is the local mode Hamiltonian. coupling uses local site labels with site 1 for the bath mode and site 2 for the coupled system site.
Prefer spin_mode for keyword-only construction.
ProcessTensors.Environments.AbstractBath — Type
AbstractBathAbstract interface for bath containers used by build_process_tensor.
Concrete baths group compatible bath modes, an optional spectral-density model, inter-mode coupling data, and the Liouville-space bath sites.
ProcessTensors.Environments.BosonicBath — Type
BosonicBath(sites, modes, spectral_density, coupling)Bath container for bosonic modes.
modes must contain BosonicMode values. sites are the concatenated Liouville sites of the modes and must be supplied explicitly. coupling represents bath-only inter-mode terms; mode-system couplings belong on each mode's coupling field.
Prefer bosonic_bath when sites should be derived from modes.
ProcessTensors.Environments.SpinBath — Type
SpinBath(sites, modes, spectral_density, coupling)Bath container for spin modes.
modes must contain SpinMode values. sites are the concatenated Liouville sites of the modes and must be supplied explicitly. coupling represents bath-only inter-mode terms; mode-system couplings belong on each mode's coupling field.
Prefer spin_bath when sites should be derived from modes.
ProcessTensors.Environments.bosonic_mode — Function
bosonic_mode(sites, H, n_max, rho0; coupling=OpSum())
bosonic_mode(sites, H, rho0; n_max=dim(only(sites))-1, coupling=OpSum())
bosonic_mode(; sites, H=OpSum(), rho0, n_max=dim(only(sites))-1, coupling=OpSum())User-facing constructor for BosonicMode.
Supports inferred n_max and keyword-only construction, then routes to the canonical BosonicMode(sites, H, n_max, rho0; coupling) constructor.
ProcessTensors.Environments.spin_mode — Function
spin_mode(sites, H, rho0; coupling=OpSum())
spin_mode(; sites, H=OpSum(), rho0, coupling=OpSum())User-facing constructor for SpinMode.
Supports keyword-only construction and routes to the canonical SpinMode(sites, H, rho0; coupling) constructor.
ProcessTensors.Environments.bosonic_bath — Function
bosonic_bath(sites, modes, spectral_density, coupling)
bosonic_bath(modes; spectral_density=ohmic_sd(), coupling=OpSum())
bosonic_bath(; modes=BosonicMode[], spectral_density=ohmic_sd(), coupling=OpSum())User-facing constructor for BosonicBath.
Mode-only forms derive sites by concatenating each mode's sites, then call the canonical four-argument constructor.
ProcessTensors.Environments.spin_bath — Function
spin_bath(sites, modes, spectral_density, coupling)
spin_bath(modes; spectral_density=ohmic_sd(), coupling=OpSum())
spin_bath(; modes=SpinMode[], spectral_density=ohmic_sd(), coupling=OpSum())User-facing constructor for SpinBath.
Mode-only forms derive sites by concatenating each mode's sites, then call the canonical four-argument constructor.
ProcessTensors.Environments.mode_initial_states — Function
mode_initial_states(bath::AbstractBath)Return the initial state of each bath mode in bath.
ProcessTensors.Spectrals.AbstractSpectralDensity — Type
AbstractSpectralDensityAbstract interface for spectral-density parameter objects.
Current process-tensor builders store these values on bath objects for API compatibility; they are not yet used to construct bath Liouvillians.
ProcessTensors.Spectrals.OhmicSpectralDensity — Type
OhmicSpectralDensity(alpha, wc, s)Ohmic spectral-density parameters, reserved for future ACE/TEMPO coupling.
ProcessTensors.Spectrals.LorentzianSpectralDensity — Type
LorentzianSpectralDensity(lambda, gamma, omega0)Lorentzian spectral-density parameters, reserved for future ACE/TEMPO coupling.
ProcessTensors.Spectrals.ohmic_sd — Function
ohmic_sd(; alpha=1.0, wc=1.0, s=1.0)Construct an OhmicSpectralDensity parameter object.
ProcessTensors.Spectrals.lorentzian_sd — Function
lorentzian_sd(; lambda=1.0, gamma=1.0, omega0=0.0)Construct a LorentzianSpectralDensity parameter object.
Instruments and schedules
ProcessTensors.Instruments.AbstractInstrument — Type
AbstractInstrumentAbstract interface for operations inserted on process-tensor legs.
Instruments represent state preparations, measurements, traces, identity connectors, explicit unitary control maps, and custom Liouville maps used by evaluate_process and evolve.
ProcessTensors.Instruments.SingleLegInstrument — Type
SingleLegInstrumentInstrument acting on one process-tensor leg.
Single-leg instruments are bound either to a primed input leg (plev = 1) or an unprimed output leg (plev = 0). Examples include StatePreparation, ObservableMeasurement, and TraceOut.
ProcessTensors.Instruments.TwoLegInstrument — Type
TwoLegInstrumentInstrument connecting one primed input process-tensor leg to one unprimed output leg.
Two-leg instruments represent maps between adjacent evolve slots, such as IdentityOperation, UnitaryPropagation, LeftRightOperator, and custom Liouville superoperators.
ProcessTensors.Instruments.StatePreparation — Type
StatePreparationSingle-leg instrument that prepares a system state on a process-tensor leg.
Canonical construction uses already-normalized fields:
StatePreparation(state, pt_sites::Vector{Index}, leg_plev::Int)Prefer state_preparation for ordinary use.
ProcessTensors.Instruments.ObservableMeasurement — Type
ObservableMeasurementSingle-leg instrument representing insertion of a Hilbert-space observable.
Canonical construction uses already-normalized fields:
ObservableMeasurement(op, pt_sites::Vector{Index}, leg_plev::Int)Prefer observable_measurement for ordinary use.
ProcessTensors.Instruments.TraceOut — Type
TraceOutSingle-leg instrument that closes a Liouville process-tensor leg with vec(I).
Canonical construction uses already-normalized fields:
TraceOut(pt_sites::Vector{Index}, leg_plev::Int)Prefer trace_out for ordinary use. Zero-argument TraceOut() is not supported; call trace_out() instead.
ProcessTensors.Instruments.LeftRightOperator — Type
LeftRightOperatorTwo-leg instrument implementing the Liouville-space map $\rho \mapsto A\rho B$.
Canonical construction uses already-normalized fields:
LeftRightOperator(left, right, input_pt_sites::Vector{Index}, output_pt_sites::Vector{Index})Prefer left_right_operator for ordinary use.
ProcessTensors.Instruments.UnitaryPropagation — Type
UnitaryPropagationTwo-leg instrument for an explicitly inserted unitary control map.
Canonical construction uses already-normalized fields:
UnitaryPropagation(input_pt_sites, output_pt_sites, H, sites)Prefer unitary_propagation for system extraction and lazy PT legs.
ProcessTensors.Instruments.IdentityOperation — Type
IdentityOperationTwo-leg identity connector between adjacent process-tensor legs.
Canonical construction uses already-normalized fields:
IdentityOperation(input_pt_sites::Vector{Index}, output_pt_sites::Vector{Index})Prefer identity_operation for ordinary use. Zero-argument IdentityOperation() is not supported; call identity_operation() instead.
ProcessTensors.Instruments.OpenOutput — Type
OpenOutputSingle-leg bookkeeping instrument that leaves one output process-tensor leg uncontracted.
Canonical construction uses already-normalized fields:
OpenOutput(pt_sites::Vector{Index}, leg_plev::Int)Prefer open_output for ordinary use. Zero-argument OpenOutput() is not supported; call open_output() instead.
ProcessTensors.Instruments.OpenInput — Type
OpenInputSingle-leg bookkeeping instrument that leaves one input process-tensor leg uncontracted.
Canonical construction uses already-normalized fields:
OpenInput(pt_sites::Vector{Index}, leg_plev::Int)Prefer open_input for ordinary use. Zero-argument OpenInput() is not supported; call open_input() instead.
ProcessTensors.Instruments.OpenInOut — Type
OpenInOutTwo-leg bookkeeping instrument that leaves both input and output process-tensor legs at one evolve slot uncontracted.
Canonical construction uses already-normalized fields:
OpenInOut(input_pt_sites::Vector{Index}, output_pt_sites::Vector{Index})Prefer open_inout for ordinary use. Zero-argument OpenInOut() is not supported; call open_inout() instead.
ProcessTensors.Instruments.CustomTwoLegInstrument — Type
CustomTwoLegInstrumentTwo-leg instrument backed by a dense ITensor on Liouville process-tensor legs.
Canonical construction uses already-normalized fields:
CustomTwoLegInstrument(data, input_pt_sites, output_pt_sites, source_input, source_output)Prefer custom_twoleg_instrument for keyword and positional convenience forms.
ProcessTensors.Instruments.ProductInstrument — Type
ProductInstrumentTwo-leg instrument at one evolve slot: an output-leg factor (plev = 0, time step - 1) and an input-leg factor (plev = 1, time step). Construct by multiplying any two SingleLegInstrument factors with * when one is on the output leg and one on the input leg (order-independent).
Examples
O_A, O_B = OpSum(), OpSum()
O_A += 1.0, "Sz", 1
O_B += 1.0, "Sx", 1
prod_instr = observable_measurement(O_B) * observable_measurement(O_A; leg_plev=1)
add!(seq, prod_instr, 2)ProcessTensors.Instruments.state_preparation — Function
state_preparation(state, pt_sites=Index[]; leg_plev=1)User-facing constructor for StatePreparation.
Hilbert inputs are converted to Liouville space when the instrument tensor is materialized. Leave pt_sites empty for lazy binding in create_instruments.
Examples
seq = InstrumentSeq(default=identity_operation(), nsteps=pt.nsteps)
add!(seq, state_preparation(ρ0), 0)ProcessTensors.Instruments.observable_measurement — Function
observable_measurement(op::OpSum, pt_sites=Index[]; leg_plev=0)User-facing constructor for ObservableMeasurement.
leg_plev=0 targets an output leg; leg_plev=1 targets an input leg for right-action correlation schedules.
Examples
O = OpSum()
O += 1.0, "Sz", 1
add!(seq, observable_measurement(O), 2)ProcessTensors.Instruments.trace_out — Function
trace_out(pt_sites=Index[]; leg_plev=0)User-facing constructor for TraceOut.
The target site must be a Liouville index of dimension $d^2$.
Examples
add!(seq, trace_out(), pt.nsteps)ProcessTensors.Instruments.left_right_operator — Function
left_right_operator(left, right, input_pt_sites=Index[], output_pt_sites=Index[])User-facing constructor for LeftRightOperator.
Both MPOs must use the same physical sites. Leave the process-tensor sites empty for lazy binding.
Examples
A = MPO(O_A, sites)
B = MPO(O_B, sites)
add!(seq, left_right_operator(A, B), 2)ProcessTensors.Instruments.unitary_propagation — Function
unitary_propagation(H::OpSum, sites)
unitary_propagation(H_of_t::Function, sites)
unitary_propagation(system::AbstractSystem)
unitary_propagation(input_pt_sites, output_pt_sites, H, sites)
unitary_propagation(input_pt_sites, output_pt_sites, system)User-facing constructor for UnitaryPropagation.
The process tensor already contains the system's baseline propagation. Use this instrument only for explicit control operations inserted into an instrument schedule. A time-dependent H_of_t is evaluated at the midpoint (k - 1/2) * dt for the map connecting output time k - 1 to input time k.
Examples
seq = default_schedule(pt)
add!(seq, unitary_propagation(H_drive, system.sites), 2)ProcessTensors.Instruments.identity_operation — Function
identity_operation(input_pt_sites=Index[], output_pt_sites=Index[])User-facing constructor for IdentityOperation.
Examples
seq = InstrumentSeq(default=identity_operation(), nsteps=pt.nsteps)ProcessTensors.Instruments.open_output — Function
open_output(pt_sites=Index[]; leg_plev=0)User-facing constructor for OpenOutput.
Place at the terminal slot pt.nsteps to return the final reduced state. open_output materializes as the scalar no-op ITensor(1.0).
Examples
add!(seq, open_output(), pt.nsteps)ProcessTensors.Instruments.open_input — Function
open_input(pt_sites=Index[]; leg_plev=1)User-facing constructor for OpenInput.
Not valid at the terminal slot pt.nsteps (no input leg exists there).
ProcessTensors.Instruments.open_inout — Function
open_inout(input_pt_sites=Index[], output_pt_sites=Index[])User-facing constructor for OpenInOut.
Unlike identity_operation, which inserts delta(in, out), open_inout materializes as ITensor(1.0) and does not connect the legs.
ProcessTensors.Instruments.custom_twoleg_instrument — Function
custom_twoleg_instrument(; data, input_pt_sites=Index[], output_pt_sites=Index[],
source_input=Index[], source_output=Index[])
custom_twoleg_instrument(data, input_pt_sites, output_pt_sites)
custom_twoleg_instrument(data; source_input, source_output, input_pt_sites=Index[],
output_pt_sites=Index[])User-facing constructor for CustomTwoLegInstrument.
Use source_input and source_output when data must be reindexed onto the target process-tensor legs at contraction time.
Examples
U = liouvillian_propagator(H, s_L, dt; jump_ops)
instr = custom_twoleg_instrument(; data=U, input_pt_sites=[in_k], output_pt_sites=[out_k])
add!(seq, instr, 1)ProcessTensors.Instruments.left_action — Method
left_action(A::AbstractMPO{Hilbert}) -> LeftRightOperator
left_action(O::OpSum, phys_sites) -> LeftRightOperatorBuild the left-action superoperator $\rho \mapsto A\rho$.
Examples
O = OpSum()
O += 1.0, "Sz", 1
add!(seq, left_action(O, sites), 2)ProcessTensors.Instruments.left_action — Method
left_action(O::OpSum, phys_sites) -> LeftRightOperatorBuild the left-action superoperator from an observable OpSum and explicit physical Hilbert-space sites.
ProcessTensors.Instruments.right_action — Method
right_action(B::AbstractMPO{Hilbert}) -> LeftRightOperator
right_action(O::OpSum, phys_sites) -> LeftRightOperatorBuild the right-action superoperator $\rho \mapsto \rho B$.
Examples
O = OpSum()
O += 1.0, "Sz", 1
add!(seq, right_action(O, sites), 3)ProcessTensors.Instruments.right_action — Method
right_action(O::OpSum, phys_sites) -> LeftRightOperatorBuild the right-action superoperator from an observable OpSum and explicit physical Hilbert-space sites.
ProcessTensors.Instruments.InstrumentSeq — Type
InstrumentSeqSchedule of instruments to contract with a ProcessTensor.
ITensorMPS.add! — Function
add!(seq, instr, tstep)Insert instr at tstep, replacing an existing explicit entry at that timestep.
Only StatePreparation is allowed at tstep = 0.
Schedule inspection and advanced dense materialisation live in the Instruments submodule. Ordinary workflows keep schedules lazy and call evaluate_process / evolve; the names below are for explicit materialisation and diagnostics:
ProcessTensors.Instruments.resolve_instrument — Function
resolve_instrument(seq, k)
resolve_instrument(seq, k, fallback)Return the instrument active at logical timestep k in an InstrumentSeq.
For ordinary evolve slots (k ≥ 1), an explicit seq.entries[k] wins; otherwise the schedule default is used. With a fallback argument, that instrument is used instead of seq.default when no explicit entry is present.
At k = 0 (initial preparation), return the explicit entry if present, else nothing — there is no default preparation.
This is part of the public ProcessTensors.Instruments API. Prefer add! / evaluate_process for ordinary schedule workflows; use resolve_instrument when inspecting or manually materialising a schedule slot.
Examples
using ProcessTensors.Instruments: resolve_instrument
seq = InstrumentSeq(default=identity_operation(), nsteps=pt.nsteps)
add!(seq, state_preparation(ρ0), 0)
add!(seq, trace_out(), pt.nsteps)
@assert resolve_instrument(seq, 0) isa StatePreparation
@assert resolve_instrument(seq, 1) isa IdentityOperation
@assert resolve_instrument(seq, pt.nsteps) isa TraceOutresolve_instrument(seq, k, fallback)See resolve_instrument.
ProcessTensors.Instruments.instrument_leg_maps — Function
instrument_leg_maps(seq, nsteps)Return dictionaries describing which instruments cover process-tensor input and output time labels, together with any missing input/output labels.
Open instruments still claim legs even when they materialize as ITensor(1.0).
ProcessTensors.Instruments.instrument_itensor — Function
instrument_itensor(instr, pt_sites, k; kwargs...)
instrument_itensor(instr, input_pt_sites, output_pt_sites, k; kwargs...)Materialize an instrument as an ITensor on process-tensor legs.
Hilbert-space preparations and observables are converted to Liouville-space objects when needed.
ProcessTensors.Instruments.create_instruments — Function
create_instruments(pt, seq; default, alg=Trotter{2}(),
progress=:auto, verbose=false)Materialize one ITensor per process-tensor schedule slot. progress controls transient terminal feedback and verbose=true emits one completion @info summary after materialization finishes.
Time evolution
ProcessTensors.tebd — Method
tebd(state::AbstractMPS{Hilbert}, H, dt, T; alg=Trotter{2}(), maxdim, cutoff,
progress=:auto, verbose=false)
tebd(state::AbstractMPS{Liouville}, H, dt, T; jump_ops=[], alg=Trotter{2}(), maxdim,
cutoff, progress=:auto, verbose=false)Time-evolve an MPS for total time T in steps of dt using TEBD.
For MPS{Hilbert}, each step applies $U = \exp(-i H\, dt)$. For MPS{Liouville}, the Liouvillian $L$ is built internally and each step applies $U = \exp(L\, dt)$.
alg must be a Trotter{n}() object from ITensors.Ops. It controls the Suzuki–Trotter factorization of the per-step propagator via trotter_gates; supported orders are 1, 2, and even n >= 4. Trotter{2}() is the default second-order choice. The gates are applied round(T/dt) times with optional truncation (maxdim, cutoff).
For exact single-step exponentiation on small Liouville spaces, use liouvillian_propagator with alg=Exact() instead of TEBD.
Examples
ψ_T = tebd(ψ0, H, 0.1, 1.0; alg=Trotter{2}())
ρL_T = tebd(ρL0, H, 0.1, 1.0; jump_ops=[(0.1, "S-", 1)])ProcessTensors.tebd — Method
tebd(state::AbstractMPS{Liouville}, H, dt, T; jump_ops=[], alg=Trotter{2}(), maxdim,
cutoff, progress=:auto, verbose=false)Liouville-space overload: see the main tebd docstring.
ITensorMPS.tdvp — Function
tdvp(H, t, psi::AbstractMPS; kwargs...) -> MPSRun ITensorMPS.tdvp on psi.core and rewrap the result with the same Hilbert or Liouville space tag as psi.
For algorithm details and keyword arguments, see the ITensorMPS documentation.
Algorithm selectors come from upstream ITensors:
using ITensors.Ops: Exact, Trotter
tebd(psi, H, dt, T; alg=Trotter{2}())
liouvillian_propagator(H, sites_L, dt; alg=Exact())Advanced gate construction is available by qualification (not root-exported):
gates = ProcessTensors.trotter_gates(H, sites, -im * dt; alg=Trotter{2}())
U, final_out = ProcessTensors.propagator_itensor_from_gates(gates, sites_L)ProcessTensors.trotter_gates — Function
trotter_gates(os, sites, τ; alg=Trotter{2}())Factorize $\exp(\tau \, \mathrm{os})$ into a vector of ITensor gates using a Suzuki–Trotter decomposition.
Schematically, for alg = Trotter{2}() the decomposition has the form
\[\exp(\tau \, \mathrm{os}) \approx \prod_{\text{groups}} \exp\!\left(\frac{\tau}{2}\, \mathrm{os}_{\text{group}}\right) \cdots \prod_{\text{groups}} \exp\!\left(\frac{\tau}{2}\, \mathrm{os}_{\text{group}}\right),\]
Orders 1 and 2 use the ITensors.Ops factorization. Even orders n >= 4 are built recursively with Yoshida's symmetric fractal composition, extending the upstream ITensors support beyond Trotter{1}() and Trotter{2}().
The nsteps field of alg matches ITensors.Ops: the generator is scaled by 1/nsteps and the resulting gate list is repeated nsteps times.
τ encodes the full exponent prefactor, including any imaginary unit and sign:
- Hilbert space:
τ = -im * dtfor unitary evolutionexp(-im H dt) - Liouville space:
τ = dt(the-imfactors are already inliouvillian_opsum)
ProcessTensors.propagator_itensor_from_gates — Function
propagator_itensor_from_gates(gates, sites)Contract a vector of Trotter gates into a single superoperator ITensor on sites by successive gate contraction with index promotion.
Returns (U::ITensor, final_out::Vector{Index}) where U has unprimed sites as ket/output legs and final_out as bra/input legs.
Tag utilities
ProcessTensors.tag_tokens — Function
tag_tokens(s::Index)Return index tags as strings. ProcessTensors uses tokens such as "Liouv", "ptype=...", and "tstep=..." for Liouville sites and process-tensor legs.
ProcessTensors.has_tag_token — Function
Return true if s has tag token exactly.
ProcessTensors.has_tag_prefix — Function
Return true if any tag on s starts with prefix.
ProcessTensors.tag_value — Function
tag_value(s::Index, prefix)Return the suffix after prefix on the first matching tag, e.g. tag_value(s, "tstep=").