API Reference
This page provides a complete reference for all exported functions in FibonacciChain.jl.
Basis and Hamiltonian Functions
FibonacciChain.anyon_basis
— Functionanyon_basis(::Type{T}, pbc::Bool=true; Y=nothing, anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Generate basis states for 1D anyon chain.
Arguments
T::Type
: BitStr type specifying chain length Npbc::Bool=true
: Periodic boundary conditionsY
: Topological charge filter (:tau
,:trivial
,0
,1
, ornothing
)anyon_type::Symbol=:Fibo
: anyon type (:Fibo
,:resetFibo
,:IsingX
,:IsingZZ
,:IsingZ
,:reset
)
Returns
Vector{T}
: Sorted basis states satisfying constraints
Supports Fibonacci anyons, Ising anyons/Majorana fermions, and spin-1/2 systems.
Examples
julia> using FibonacciChain, BitBasis
julia> # Generate Fibonacci basis for N=4 with PBC
N = 4; T = BitStr{N, Int};
julia> basis_fibo = anyon_basis(T, true, anyon_type=:Fibo);
julia> length(basis_fibo) # Fibonacci numbers give the dimension
7
julia> basis_fibo[1] # First basis state (vacuum)
0000 ₍₂₎
julia> # Generate Ising basis for comparison
basis_ising = anyon_basis(T, true, anyon_type=:IsingX);
julia> length(basis_ising) # All 2^N states for Ising
16
anyon_basis(::Type{T}, k::Int64; Y=nothing, anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Generate basis states in specific momentum sector k
and topological sector Y
.
Arguments
T::Type
: BitStr type specifying chain length Nk::Int64
: Momentum sector (0 ≤ k ≤ N-1)Y
: Topological charge sectoranyon_type::Symbol=:Fibo
: anyon type
Returns
Vector{T}
: Basis states in momentum sector kDict{T, Vector{T}}
: Representative mapping for translation equivalence classes
FibonacciChain.anyon_ham
— Functionanyon_ham(::Type{T}, pbc::Bool=true; anyon_type::Symbol=:Fibo, kwargs...) where {N, T <: BitStr{N}}
Construct Hamiltonian matrix for 1D anyon chain.
Arguments
T::Type
: BitStr type specifying chain length Npbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon typekwargs...
: Additional model parameters, e.g.,J
,h
for Ising model.
Returns
Matrix{Float64}
: Hamiltonian matrix in chosen basis
Supports various anyon models including Fibonacci and Ising anyons.
Examples
julia> using FibonacciChain, BitBasis
julia> N = 4; T = BitStr{N,Int};
julia> H_fibo = anyon_ham(T, true, anyon_type=:Fibo);
julia> size(H_fibo) # Hamiltonian dimension matches basis size
(7, 7)
julia> H_Ising = anyon_ham(T, true, anyon_type=:IsingX, J=1.0, h=1.0);
julia> size(H_Ising) # full Hilbert space for Ising model
(16, 16)
anyon_ham(::Type{T}, k::Int; Y=nothing, anyon_type::Symbol=:Fibo, kwargs...) where {N, T <: BitStr{N}}
Construct Hamiltonian matrix in specific symmetry sector for 1D anyon chain.
Arguments
T::Type
: BitStr type specifying chain length Npbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon typekwargs...
: Additional model parameters, e.g.,J
,h
for Ising model.
Returns
Matrix{Float64}
: Hamiltonian matrix in chosen basis
FibonacciChain.anyon_ham_sparse
— Functionanyon_ham_sparse(::Type{T}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Construct anyon chain Hamiltonian as sparse matrix.
Arguments
T::Type
: BitStr type specifying chain length Npbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model typekwargs...
: Additional keyword arguments passed toactingHam
, e.g.J
,h
.
Returns
SparseMatrixCSC{Float64, Int}
: Sparse Hamiltonian matrix in anyon basis
Examples
julia> using FibonacciChain, BitBasis, SparseArrays, LinearAlgebra
julia> N = 6; T = BitStr{N, Int};
julia> H_sparse = anyon_ham_sparse(T, true, anyon_type=:Fibo);
julia> H_sparse isa SparseMatrixCSC # Check it's a sparse matrix
true
julia> ishermitian(H_sparse) # Should be Hermitian
true
julia> H_dense = anyon_ham(N, true); # Compare with dense version for small system
julia> norm(Matrix(H_sparse) - H_dense) < 1e-10
true
anyon_ham_sparse(::Type{T}, k::Int, Y=nothing; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Construct Hamiltonian in momentum-topological sector as sparse matrix.
Arguments
T::Type
: BitStr type specifying chain length Nk::Int
: Momentum quantum number (0 ≤ k ≤ N-1)Y
: Topological charge sectoranyon_type::Symbol=:Fibo
: Model typekwargs...
: Additional keyword arguments passed toactingHam
, e.g.J
,h
.
Returns
SparseMatrixCSC{ComplexF64, Int}
: Sparse Hamiltonian in symmetric sector
Reduced Density Matrices
FibonacciChain.anyon_rdm
— Functionanyon_rdm(::Type{T}, subsystems::Vector{Int64}, state::Union{Vector{ET}, Matrix{ET}}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N,T <: BitStr{N}, ET}
Compute reduced density matrix for specified subsystems from quantum state or density matrix.
Arguments
T::Type
: BitStr type specifying chain length Nsubsystems::Vector{Int64}
: Indices of subsystem sites to keepstate::Union{Vector{ET}, Matrix{ET}}
: Quantum state vector or density matrixpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Matrix{ET}
: Reduced density matrix for specified subsystems
Subsystem indices are counted from right in binary representation.
Examples
julia> using FibonacciChain, BitBasis, LinearAlgebra
julia> N = 4; T = BitStr{N, Int};
julia> basis = anyon_basis(T, true, anyon_type=:Fibo);
julia> state = randn(ComplexF64, length(basis)); state ./= norm(state);
julia> rdm = anyon_rdm(T, [1, 2], state, true, anyon_type=:Fibo);
julia> size(rdm) # Reduced density matrix dimension
(3, 3)
julia> ishermitian(rdm) # RDM should be Hermitian
true
julia> tr(rdm) ≈ 1.0 + 0.0im # Trace should be 1
true
FibonacciChain.anyon_rdm_sec
— Functionanyon_rdm_sec(::Type{T}, subsystems::Vector{Int64}, kstate::Vector{ET}, k::Int64) where {N,T <: BitStr{N}, ET}
Compute reduced density matrix for specified subsystems from quantum state or density matrix in specific symmetry sector.
Arguments
T::Type
: BitStr type specifying chain length Nsubsystems::Vector{Int64}
: Indices of subsystem sites to keepkstate::Vector{ET}
: State vector in symmetric sector Hilbert spacek::Int64
: Momentum sector (0 ≤ k ≤ N-1)anyon_type::Symbol=:Fibo
: anyon type
Returns
Matrix{ET}
: Reduced density matrix in total Hilbert basis
FibonacciChain.disjoint_rdm
— Functiondisjoint_rdm(::Type{T1}, ::Type{T2}, subsystemsA::Vector{Int64}, subsystemsB::Vector{Int64}, state::Vector{ET}, pbc::Bool=true; totalsubApbc::Bool=false, totalsubBpbc::Bool=false, anyon_typeA::Symbol=:Fibo, anyon_typeB::Symbol=:Fibo) where {N1, N2,T1 <: BitStr{N1},T2 <: BitStr{N2}, ET}
Compute reduced density matrix for two joint different systems, or two parallel chains. Where specified subsystems is given, output quantum state or density matrix.
Arguments
T1::Type
: BitStr type specifying chain length N1T2::Type
: BitStr type specifying chain length N2subsystemsA::Vector{Int64}
: Indices of subsystem sites to keepsubsystemsB::Vector{Int64}
: Indices of subsystem sites to keepstate::Vector{ET}
: Quantum state vector in total Hilbert spacepbc::Bool=true
: Periodic boundary conditionstotalsubApbc::Bool=false
: Whether the total subsystem A is periodictotalsubBpbc::Bool=false
: Whether the total subsystem B is periodicanyon_typeA::Symbol=:Fibo
: anyon type for subsystem Aanyon_typeB::Symbol=:Fibo
: anyon type for subsystem B
Returns
Matrix{ET}
: Reduced density matrix in total Hilbert basis
Examples
julia> using FibonacciChain, BitBasis, LinearAlgebra
julia> N1, N2 = 4, 4; T1, T2 = BitStr{N1,Int}, BitStr{N2,Int};
julia> basisA = anyon_basis(T1, true, anyon_type=:Fibo);
julia> basisB = anyon_basis(T2, true, anyon_type=:Fibo);
julia> state = randn(ComplexF64, length(basisA) * length(basisB));
julia> state ./= norm(state);
julia> rdm = disjoint_rdm(T1, T2, [1,2], [1,2], state, true,
totalsubApbc=false, totalsubBpbc=false,
anyon_typeA=:Fibo, anyon_typeB=:Fibo);
julia> size(rdm) # reduced density matrix dimension
(9, 9)
julia> ishermitian(rdm) # should be Hermitian
true
julia> tr(rdm) ≈ 0.9999999999999999 + 0.0im # trace should be 1
true
FibonacciChain.mapst_sec2tot
— Functionmapst_sec2tot(::Type{T}, state::Vector{ET}, k::Int64; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}, ET}
map state in symmetric sector to total Hilbert space.
Arguments
T::Type
: BitStr type specifying chain length Nstate::Vector{ET}
: State vector in symmetric sector Hilbert spaceanyon_type::Symbol=:Fibo
: anyon type
Returns
Vector{ET}
: Total space state vector
Entanglement and Observables
FibonacciChain.ee
— Functionee(subrm::Matrix{ET}) where {ET}
Calculate entanglement entropy from reduced density matrix.
Arguments
subrm::Matrix{ET}
: Hermitian reduced density matrix
Returns
Float64
: von Neumann entanglement entropy
Examples
julia> using FibonacciChain, LinearAlgebra
julia> # Create a simple 2x2 density matrix
ρ = [0.5 0.0; 0.0 0.5]; # Maximally mixed state
julia> entropy = ee(ρ);
julia> abs(entropy - log(2)) < 1e-10 # Should equal log(2) ≈ 0.693
true
julia> # Pure state has zero entropy
ρ_pure = [1.0 0.0; 0.0 0.0];
julia> ee(ρ_pure) ≈ 0.0
true
FibonacciChain.anyon_eelis
— Functionanyon_eelis(N::Int64, state::Union{Vector{ET}, Matrix{ET}}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {ET}
Calculate entanglement entropy profile along the chain for given quantum state or density matrix.
Arguments
N::Int64
: System sizestate::Union{Vector{ET}, Matrix{ET}}
: Quantum state vector or density matrix in anyon basispbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
Vector{Float64}
: Entanglement entropy at each bipartition from left to right
Examples
julia> using FibonacciChain, LinearAlgebra
julia> N = 6;
julia> # Create ground state of Fibonacci Hamiltonian
H = anyon_ham(N, true);
julia> eigenvals, eigenvecs = eigen(H);
julia> ground_state = eigenvecs[:, 1];
julia> # Calculate entanglement entropy profile
ee_profile = anyon_eelis(N, ground_state, true);
julia> length(ee_profile) == N - 1 # Profile has N-1 points
true
julia> all(x -> x ≥ 0, ee_profile) # All entropies are non-negative
true
FibonacciChain.ee_mps
— Functioncalculate_entanglement_entropy_mps(ψ::MPS, b::Int) -> Float64
Calculate entanglement entropy of MPS state with bipartition at bond b.
FibonacciChain.anyon_eelis_mps
— Functionanyon_eelis_mps(N::Int64, ψ::MPS)
Calculate entanglement entropy profile along the chain for MPS state.
Arguments
N::Int64
: System sizeψ::MPS
: MPS state
Returns
Vector{Float64}
: Entanglement entropy at each bipartition from left to right
Examples
julia> using FibonacciChain, ITensorMPS, ITensors
julia> N = 6;
julia> ψ_gs, E0 = fibonacci_mps_ground_state(N, pbc=true, maxdim=10, outputlevel=0);
julia> # Calculate entanglement entropy profile
ee_profile = anyon_eelis_mps(N, ψ_gs);
julia> length(ee_profile) == N - 1 # Profile has N-1 points
true
julia> all(x -> x ≥ 0, ee_profile) # All entropies are non-negative
true
Symmetry Operations
FibonacciChain.translation_matrix
— Functiontranslation_matrix(::Type{T}) where {N, T <: BitStr{N}}
Generate translation operator matrix for Fibonacci basis states.
Arguments
T::Type
: BitStr type specifying chain length N
Returns
Matrix{Float64}
: Translation matrix mapping each basis state to its translated version
FibonacciChain.inversion_matrix
— Functioninversion_matrix(::Type{T}) where {N, T <: BitStr{N}}
Generate spatial inversion operator matrix for Fibonacci basis states.
Arguments
T::Type
: BitStr type specifying chain length N
Returns
Matrix{Float64}
: Inversion matrix mapping each basis state to its spatially reflected version
FibonacciChain.braidingsqmap
— Functionbraidingsqmap(::Type{T}, state::Vector{ET}, idx::Int, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}, ET}
Apply braiding squared operation to quantum state at specified site.
Arguments
T::Type
: BitStr type specifying chain length Nstate::Vector{ET}
: Quantum state vector in anyon basisidx::Int
: Site index for braiding operationpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Vector{ET}
: Transformed state after braiding operation
FibonacciChain.topological_symmetry_basismap
— Functiontopological_symmetry_basismap(state::T, pbc::Bool=true) where {N, T <: BitStr{N}}
Compute topological symmetry coefficients for all basis states relative to given state.
Arguments
state::T
: Reference state configurationpbc::Bool=true
: Periodic boundary conditions
Returns
Vector{Float64}
: Coefficients for each basis state
Examples
julia> using FibonacciChain, BitBasis
julia> N = 4; T = BitStr{N, Int};
julia> state = T(0b0000); # Vacuum state
julia> coeffs = topological_symmetry_basismap(state, true);
julia> length(coeffs) == length(anyon_basis(T, true, anyon_type=:Fibo))
true
julia> all(x -> abs(x) > 1e-10 || abs(x) < 1e-10, coeffs) # All coeffs are well-defined
true
FibonacciChain.Fsymmetry_coef
— FunctionFsymmetry_coef(state::T, base::T, pbc::Bool=true, anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Compute topological symmetry coefficient for state in given base configurations for Fibonacci anyon chain.
Arguments
state::T
: Target state configurationbase::T
: Base state configurationpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Measurement class
Returns
Float64
: Topological symmetry coefficient based on Fibonacci fusion rules
Examples
julia> using FibonacciChain, BitBasis
julia> N = 4; T = BitStr{N, Int};
julia> state = T(0b1010); ϕ = (1 + sqrt(5)) / 2; # Example state configuration
julia> base = T(0b0101); # Example base configuration
julia> coef = Fsymmetry_coef(state, base, true, :Fibo); coef ≈ 0.3819660112501051
true
julia> abs(coef - (1-1/ϕ)) < 1e-10 # Should equal φ for this configuration
true
Ladder System Functions
FibonacciChain.ladderChoi
— FunctionladderChoi(::Type{T}, p::Float64, state::Vector{ET}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N,T <: BitStr{N}, ET}
Apply probabilistic braiding noise channel to density matrix state in vec form.
Arguments
T::Type
: BitStr type specifying chain length Np::Float64
: Braiding probability (0 ≤ p ≤ 1)state::Vector{ET}
: Density matrix state in vectorized formpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Vector{ET}
: State after applying Choi map with braiding noise
Implements noise channel: ρ → (1-p)ρ + p B(ρ) where B is braiding operation.
FibonacciChain.ladderrdm
— Functionladderrdm(::Type{T}, subsystems::Vector{Int64}, state::Vector{ET}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N,T <: BitStr{N}, ET}
Compute reduced density matrix for specified subsystem from vectorized density matrix.
Arguments
T::Type
: BitStr type specifying chain length Nsubsystems::Vector{Int64}
: Indices of subsystem sites to trace outstate::Vector{ET}
: Full density matrix state in vectorized formpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Matrix{Float64}
: Reduced density matrix of the subsystem
For ladder systems where both subsystems have equal dimensions.
FibonacciChain.ladderbraidingsqmap
— Functionladderbraidingsqmap(::Type{T}, state::Vector{ET}, idx::Int, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}, ET}
Apply braiding squared operation to density matrix state in vectorized form. Effectively, it's the noise induced by inter-two layer chain braiding.
Arguments
T::Type
: BitStr type specifying chain length Nstate::Vector{ET}
: Density matrix state in vectorized formidx::Int
: Site index for braiding operationpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Vector{ET}
: Transformed density matrix state after braiding
Operates on superposition states represented as vectorized density matrices.
Examples
julia> using FibonacciChain, LinearAlgebra, BitBasis
julia> N = 4; T = BitStr{N, Int};
julia> # Create PBC Fibonacci anyon basis
basis = anyon_basis(T, true, anyon_type=:Fibo);
julia> l = length(basis);
julia> ρ_vec = zeros(ComplexF64, l^2);
julia> # Initialize as identity matrix (vectorized)
for i in 1:l
ρ_vec[(i-1)*l + i] = 1.0/l;
end
julia> # Apply braiding at site 2
ρ_braided = ladderbraidingsqmap(T, ρ_vec, 2, true);
julia> norm(ρ_braided) > 0 # Should be non-zero
true
FibonacciChain.laddertranslationmap
— Functionladdertranslationmap(::Type{T}, state::Vector{ET}) where {N, T <: BitStr{N}, ET}
Apply translation operator to vectorized density matrix state.
Arguments
T::Type
: BitStr type specifying chain length Nstate::Vector{ET}
: Density matrix state in vectorized form
Returns
Vector{ET}
: Translated density matrix state
Translates both bra and ket parts of the density matrix consistently.
Measurement Functions
FibonacciChain.measure_basismap
— Functionmeasure_basismap(::Type{T}, τ::Float64, state::T, i::Int, sign::Int64, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}}
Map single basis state under measurement operation at site i.
Arguments
T::Type
: BitStr type specifying chain length Nτ::Float64
: Measurement strength parameterstate::T
: Input basis statei::Int
: Measurement site index (1 ≤ i ≤ N)sign::Int64
: Measurement outcome (0 for +, 1 for -)pbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
- Basis-dependent output: Either
(basis, coefficient)
or(basis1, basis2, coeff1, coeff2)
Maps individual basis states according to measurement protocols and fusion rules. Here we choose Heisenberg-like preferring way, selecting specific fusion outcome.
Examples
julia> using FibonacciChain, BitBasis
julia> N = 4; T = BitStr{N, Int};
julia> state = T(0b0100); # Single τ at site 2
julia> τ = 1.0; # Measurement strength
julia> # Measure at site 2 with outcome + (sign=0)
result = measure_basismap(T, τ, state, 2, 0, true);
julia> length(result) ∈ [2, 4] # Returns 2 or 4 elements depending on configuration
true
julia> # The first element is always a basis state
typeof(result[1]) == T
true
FibonacciChain.measurement_enumeration
— Functionmeasurement_enumeration(::Type{T}, τ::Float64, initial_state::Vector{ET}, measurement_sites::Vector{Int}, pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}, ET}
Enumerating all trajectories of measurements on a given initial state.
Args:T, τ, initialstate, measurementsites, pbc
Returns: final_states, trajectories, probabilities
FibonacciChain.Boundary_measure
— FunctionBoundary_measure(::Type{T}, τ::Float64, state::Vector{ET}, measurement_sites::Vector{Int}, num_samples::Int=1000, rng::MersenneTwister=MersenneTwister(), pbc::Bool=true; anyon_type::Symbol=:Fibo) where {N, T <: BitStr{N}, ET}
Generate measurement samples at boundary sites with probabilistic outcomes, i.e., without time axis evolution.
Arguments
T::Type
: BitStr type specifying chain length Nτ::Float64
: Measurement strength parameterstate::Vector{ET}
: Initial quantum state vectormeasurement_sites::Vector{Int}
: Sites to perform measurementsnum_samples::Int=1000
: Number of measurement samples to generaterng::MersenneTwister
: Random number generatorpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
Tuple{Vector{Vector{Float64}}, Vector{Vector{Int64}}, Vector{Float64}}
: (post-measurement states, measurement sequences, free energies)
Samples measurement outcomes probabilistically based on Born rule.
FibonacciChain.Boundarypost_selection
— FunctionBoundarypost_selection(N::Int64, τ::Float64, state::Vector{ET}, measurement_sites::Vector{Int}, sign::Int64, pbc::Bool=true; anyon_type::Symbol=:Fibo)
Generate measurement samples at boundary sites with post_selection outcomes, i.e., given spatial evolution without time axis evolution.
Arguments
N::Int
: Chain length Nτ::Float64
: Measurement strength parameterstate::Vector{ET}
: Initial quantum state vectormeasurement_sites::Vector{Int}
: Sites to perform measurementspbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
Tuple{Vector{Vector{Float64}}, Vector{Vector{Int64}}, Vector{Float64}}
: (post-measurement states, measurement sequences, free energies)
Samples measurement outcomes with given measurement outcomes.
FibonacciChain.Bulkmeasure
— FunctionBulkmeasure(N::Int64, τ::Float64, state::Vector{ET}, D::Int64, rng::MersenneTwister=MersenneTwister(), pbc::Bool=true; anyon_type::Symbol=:Fibo)
Generate measurement samples at bulk sites with probabilistic outcomes, i.e., with time axis evolution, together with spatial evolution axis as bulk.
Arguments
N::Int
: Chain length Nτ::Float64
: Measurement strength parameterstate::Vector{ET}
: Initial quantum state vectorD::Int64
: Number of measurement layers (depth), or time step (over 2)rng::MersenneTwister
: Random number generatorpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
Tuple{Vector{Vector{Float64}}, Vector{Vector{Int64}}, Vector{Float64}}
: (post-measurement states, measurement sequences, free energies)
Samples measurement outcomes probabilistically based on Born rule.
FibonacciChain.Bulkpost_selection
— FunctionBulkpost_selection(N::Int64, τ::Float64, state::Vector{ET}, D::Int64, sign::Int64, pbc::Bool=true; anyon_type::Symbol=:Fibo)
Generate measurement samples at bulk sites with post_selection outcomes, i.e., with time axis evolution, together with spatial evolution axis as bulk.
Arguments
N::Int
: Chain length Nτ::Float64
: Measurement strength parameterstate::Vector{ET}
: Initial quantum state vectorD::Int64
: Number of measurement layers (depth), or time step (over 2)sign::Int64
: Measurement sign, 0 for positive, 1 for negativepbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: anyon type
Returns
Tuple{Vector{Vector{Float64}}, Vector{Vector{Int64}}, Vector{Float64}}
: (post-measurement states, measurement sequences, free energies)
Samples measurement outcomes with given measurement outcomes.
MPS Functions
FibonacciChain.fibonacci_hamiltonian_mps
— Functionfibonacci_hamiltonian_mps(sites; pbc::Bool=true)
Construct Fibonacci chain Hamiltonian as Matrix Product Operator (MPO).
Arguments
sites
: ITensor site indicespbc::Bool=true
: Periodic boundary conditions
Returns
MPO
: Hamiltonian with three-body interactions based on Fibonacci fusion rules
FibonacciChain.measurement_operator_mps
— Functionmeasurement_operator_mps(sites, i::Int, τ::Float64, sign::Int64; pbc::Bool=true, anyon_type::Symbol=:Fibo)
Create local measurement operator at site i as Matrix Product Operator.
Arguments
sites
: ITensor site indicesi::Int
: Measurement siteτ::Float64
: Evolution time parametersign::Int64
: Measurement outcome (0 or 1)pbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
ITensor
: Local measurement operator incorporating neighboring site correlations
FibonacciChain.apply_measurement_mps
— Functionapply_measurement_mps(ψ::MPS, sites, i::Int, τ::Float64, sign::Int64; pbc::Bool=true, cutoff::Float64=1e-10, maxdim::Int=100, anyon_type::Symbol=:Fibo)
Apply measurement operator to MPS state and return post-measurement state.
Arguments
ψ::MPS
: Input quantum statesites
: ITensor site indicesi::Int
: Measurement siteτ::Float64
: Evolution time parametersign::Int64
: Measurement outcomepbc::Bool=true
: Periodic boundary conditionscutoff::Float64=1e-10
: MPS truncation cutoffmaxdim::Int=100
: Maximum bond dimensionanyon_type::Symbol=:Fibo
: Model type
Returns
MPS
: Post-measurement quantum stateFloat64
: Measurement probability
FibonacciChain.initial_mps
— Functionfibonacci_mps_ground_state(N::Int; pbc::Bool=true, sweep_times=20, maxdim=50, cutoff=1e-10)
Find ground state of Fibonacci chain Hamiltonian using DMRG.
Arguments
N::Int
: System sizepbc::Bool=true
: Periodic boundary conditionssweep_times=20
: Number of DMRG sweepsmaxdim=50
: Maximum bond dimensioncutoff=1e-10
: Truncation cutoff
Returns
MPS
: Ground state as Matrix Product StateFloat64
: Ground state energy
Examples
julia> using FibonacciChain, ITensorMPS, ITensors
julia> N = 8;
julia> ψ_gs, E0 = fibonacci_mps_ground_state(N, pbc=true, maxdim=10, outputlevel=0);
julia> ψ_gs isa MPS
true
julia> E0 < 0 && imag(E0) ≈ 0
true
FibonacciChain.mps_measurement_enumeration
— Functionmps_measurement_enumeration(ψ::MPS, sites, measurement_sites::Vector{Int}, τ::Float64;
pbc::Bool=true) -> Vector{MPS}, Vector{Vector{Int64}}, Vector{Float64}
Enumerate all possible measurement trajectories on MPS state.
FibonacciChain.mps_boundary_measure
— Functionmps_boundary_measure(ψ::MPS, sites, measurement_sites::Vector{Int}, τ::Float64;
num_samples::Int=1000, pbc::Bool=true) -> Vector{Vector{Int64}}, Vector{Float64}
Perform boundary measurements on MPS state.
FibonacciChain.mps_bulk_measurement
— Functionmps_bulk_measurement(ψ::MPS, sites, N::Int, τ::Float64, D::Int; pbc::Bool=true)
Perform bulk measurements on MPS with D layers.
Reference Qubit Functions
FibonacciChain.spatial_correlation
— Functionspatial_correlation(N::Int64, state::Union{Vector{ET}, Matrix{ET}}, site1::Int64, site2::Int64; pbc::Bool=true, anyon_type::Symbol=:Fibo) where {ET}
Calculate mutual information between two sites as spatial correlation measure.
Arguments
N::Int64
: System sizestate::Union{Vector{ET}, Matrix{ET}}
: Quantum state vector or density matrixsite1::Int64
: First site index (1 ≤ site1 ≤ N)site2::Int64
: Second site index (1 ≤ site2 ≤ N, site2 ≠ site1)pbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Float64
: Mutual information I(1:2) = S(1) + S(2) - S(1,2)
Computes quantum mutual information as measure of spatial correlations.
FibonacciChain.temporal_correlation
— Functiontemporal_correlation(N::Int64, state_addref2::Vector{ET}; pbc::Bool=true, anyon_type::Symbol=:Fibo) where {ET}
Calculate temporal correlation using state with two reference qubits.
Arguments
N::Int64
: System sizestate_addref2::Vector{ET}
: Quantum state with two reference qubits addedpbc::Bool=true
: Periodic boundary conditionsanyon_type::Symbol=:Fibo
: Model type
Returns
Float64
: Temporal correlation measure between time slices
Uses reference qubit protocol to measure temporal correlations at single site.