FibonacciChain.jl

FibonacciChain.jl is a Julia package for simulating 1D interacting anyons chain, particularly focusing on Fibonacci anyons and related topological systems.

Overview

This package provides comprehensive tools for studying anyon chains based on the principle that, $(2+1) \mathrm{D}$ bulk TQFT has correspondence to $(1+1) \mathrm{D}$ boundary CFT. Similar to the Heisenberg model where singlet states have lower energy, fusion outcomes with trivial topological charge are energetically preferred. Then we can write down a interacting Hamiltonian.

Supported Anyon Types

The package currently supports three types of anyonic systems:

  • Ising Anyons (SU(2)₂): Majorana fermions with non-Abelian statistics
  • Fibonacci Anyons (SU(2)₃): Universal anyons for quantum computation
  • Spin-1/2 Systems (SU(2)∞): Regular spin systems

Key Features

  • Exact Diagonalization: Full quantum many-body calculations for small systems
  • Matrix Product States (MPS): Efficient simulation of larger systems using ITensors.jl
  • Measurement Protocols: Quantum measurement and post-selection dynamics
  • Topological Properties: Utilizing topological symmetry sector.
  • Anyon Operations: Implementation of anyonic braiding and exchange statistics, fusion operation.

Installation

using Pkg
Pkg.add("FibonacciChain")

Quick Start

using FibonacciChain

# Create a Fibonacci anyon chain with N=6 sites
N = 6
basis = anyon_basis(N, true)  # periodic boundary conditions

# Generate the Hamiltonian
H = anyon_ham(N, true)

# Find ground state
eigenvals, eigenvecs = eigen(H)
ground_state = eigenvecs[:, 1]

# Calculate entanglement entropy profile
ee_profile = anyon_eelis(N, ground_state)

Documentation Sections

Theoretical Background

The package implements the anyon chain Hamiltonian described in Phys. Rev. Lett. 98, 160409 (2007), where the energy scale is determined by favoring trivial fusion channels in three-body interactions.

For Fibonacci anyons, the local Hamiltonian terms involve three consecutive anyons and depend on their fusion outcomes according to the golden ratio φ = (1+√5)/2, which characterizes the Fibonacci fusion algebra.

API Reference

FibonacciChain.Boundary_measureMethod
Boundary_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 parameter
  • state::Vector{ET}: Initial quantum state vector
  • measurement_sites::Vector{Int}: Sites to perform measurements
  • num_samples::Int=1000: Number of measurement samples to generate
  • rng::MersenneTwister: Random number generator
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.Boundarypost_selectionMethod
Boundarypost_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 parameter
  • state::Vector{ET}: Initial quantum state vector
  • measurement_sites::Vector{Int}: Sites to perform measurements
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.BulkmeasureMethod
Bulkmeasure(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 parameter
  • state::Vector{ET}: Initial quantum state vector
  • D::Int64: Number of measurement layers (depth), or time step (over 2)
  • rng::MersenneTwister: Random number generator
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.Bulkpost_selectionMethod
Bulkpost_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 parameter
  • state::Vector{ET}: Initial quantum state vector
  • D::Int64: Number of measurement layers (depth), or time step (over 2)
  • sign::Int64: Measurement sign, 0 for positive, 1 for negative
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.Fsymmetry_coefMethod
Fsymmetry_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 configuration
  • base::T: Base state configuration
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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
source
FibonacciChain.add_reference_qubits!Method
add_reference_qubits!(N::Int, state::Vector{ET}, site_idx::Int64, rng::MersenneTwister=MersenneTwister(); k_new::Int=1, pbc::Bool=true, anyon_type::Symbol=:Fibo) where {ET}

Add reference qubits to quantum state at specified site for correlation measurements.

Arguments

  • N::Int: System size
  • state::Vector{ET}: Quantum state vector
  • site_idx::Int64: Site index for reference qubit insertion (1 ≤ site_idx ≤ N)
  • k_new::Int=1: Number of new reference qubits to add (0 or 1)
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: anyon type
  • verbose::Bool=false: Enable verbose output
  • entangle_way::Symbol=:copy: Method to entangle reference qubit, either :copy or :reset

Returns

  • Vector{ET}: New state with reference qubits in maximally entangled configuration

For multiple reference qubits, call this function multiple times at different sites.

source
FibonacciChain.anyon_basisMethod
anyon_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 N
  • pbc::Bool=true: Periodic boundary conditions
  • Y: Topological charge filter (:tau, :trivial, 0, 1, or nothing)
  • 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
source
FibonacciChain.anyon_basisMethod
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 N
  • k::Int64: Momentum sector (0 ≤ k ≤ N-1)
  • Y: Topological charge sector
  • anyon_type::Symbol=:Fibo: anyon type

Returns

  • Vector{T}: Basis states in momentum sector k
  • Dict{T, Vector{T}}: Representative mapping for translation equivalence classes
source
FibonacciChain.anyon_eelisMethod
anyon_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 size
  • state::Union{Vector{ET}, Matrix{ET}}: Quantum state vector or density matrix in anyon basis
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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
source
FibonacciChain.anyon_eelis_mpsMethod
anyon_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
source
FibonacciChain.anyon_hamMethod
anyon_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 N
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: anyon type
  • kwargs...: 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)
source
FibonacciChain.anyon_hamMethod
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 N
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: anyon type
  • kwargs...: Additional model parameters, e.g., J, h for Ising model.

Returns

  • Matrix{Float64}: Hamiltonian matrix in chosen basis
source
FibonacciChain.anyon_ham_sparseMethod
anyon_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 N
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type
  • kwargs...: Additional keyword arguments passed to actingHam, 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
source
FibonacciChain.anyon_ham_sparseMethod
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 N
  • k::Int: Momentum quantum number (0 ≤ k ≤ N-1)
  • Y: Topological charge sector
  • anyon_type::Symbol=:Fibo: Model type
  • kwargs...: Additional keyword arguments passed to actingHam, e.g. J, h.

Returns

  • SparseMatrixCSC{ComplexF64, Int}: Sparse Hamiltonian in symmetric sector
source
FibonacciChain.anyon_rdmMethod
anyon_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 N
  • subsystems::Vector{Int64}: Indices of subsystem sites to keep
  • state::Union{Vector{ET}, Matrix{ET}}: Quantum state vector or density matrix
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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
source
FibonacciChain.anyon_rdm_secMethod
anyon_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 N
  • subsystems::Vector{Int64}: Indices of subsystem sites to keep
  • kstate::Vector{ET}: State vector in symmetric sector Hilbert space
  • k::Int64: Momentum sector (0 ≤ k ≤ N-1)
  • anyon_type::Symbol=:Fibo: anyon type

Returns

  • Matrix{ET}: Reduced density matrix in total Hilbert basis
source
FibonacciChain.apply_measurement_mpsMethod
apply_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 state
  • sites: ITensor site indices
  • i::Int: Measurement site
  • τ::Float64: Evolution time parameter
  • sign::Int64: Measurement outcome
  • pbc::Bool=true: Periodic boundary conditions
  • cutoff::Float64=1e-10: MPS truncation cutoff
  • maxdim::Int=100: Maximum bond dimension
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • MPS: Post-measurement quantum state
  • Float64: Measurement probability
source
FibonacciChain.bayes_distortMethod

Distort the measurement trajectories based on a Bayesian distortion factor γ. Noting that it only works for one layer measurement to generate new sample for the other factor γ based on Projective limit measurement.

This function implements the distortion process where each faithful sample s is converted to a distorted sample s̃ according to the conditional probability: P(s̃|s) = ∏ⱼ (1 + γ s̃ⱼ sⱼ)/2

Args: γ: Distortion factor (readout fidelity parameter, 0 ≤ γ ≤ 1). trajectories: Vector of measurement trajectories. probabilities: Corresponding probabilities for each trajectory.

Returns: Tuple of (distortedtrajectories, distortedprobabilities) where: - distortedtrajectories: All possible distorted trajectories - distortedprobabilities: Their corresponding probabilities after distortion in corresponding order.

source
FibonacciChain.braidingsq_basismapMethod
braidingsqmap(::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 N
  • state::Vector{ET}: Quantum state vector in anyon basis
  • idx::Int: Site index for braiding operation
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Vector{ET}: Transformed state after braiding operation

Braiding is a fundamental topological operation that exchanges adjacent anyons.

source
FibonacciChain.braidingsqmapMethod
braidingsqmap(::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 N
  • state::Vector{ET}: Quantum state vector in anyon basis
  • idx::Int: Site index for braiding operation
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Vector{ET}: Transformed state after braiding operation
source
FibonacciChain.disjoint_rdmMethod
disjoint_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 N1
  • T2::Type: BitStr type specifying chain length N2
  • subsystemsA::Vector{Int64}: Indices of subsystem sites to keep
  • subsystemsB::Vector{Int64}: Indices of subsystem sites to keep
  • state::Vector{ET}: Quantum state vector in total Hilbert space
  • pbc::Bool=true: Periodic boundary conditions
  • totalsubApbc::Bool=false: Whether the total subsystem A is periodic
  • totalsubBpbc::Bool=false: Whether the total subsystem B is periodic
  • anyon_typeA::Symbol=:Fibo: anyon type for subsystem A
  • anyon_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
source
FibonacciChain.eeMethod
ee(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
source
FibonacciChain.ee_mpsMethod
calculate_entanglement_entropy_mps(ψ::MPS, b::Int) -> Float64

Calculate entanglement entropy of MPS state with bipartition at bond b.

source
FibonacciChain.fibonacci_hamiltonian_mpsMethod
fibonacci_hamiltonian_mps(sites; pbc::Bool=true)

Construct Fibonacci chain Hamiltonian as Matrix Product Operator (MPO).

Arguments

  • sites: ITensor site indices
  • pbc::Bool=true: Periodic boundary conditions

Returns

  • MPO: Hamiltonian with three-body interactions based on Fibonacci fusion rules
source
FibonacciChain.initial_mpsMethod
fibonacci_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 size
  • pbc::Bool=true: Periodic boundary conditions
  • sweep_times=20: Number of DMRG sweeps
  • maxdim=50: Maximum bond dimension
  • cutoff=1e-10: Truncation cutoff

Returns

  • MPS: Ground state as Matrix Product State
  • Float64: 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
source
FibonacciChain.inversion_matrixMethod
inversion_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
source
FibonacciChain.ladderChoiMethod
ladderChoi(::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 N
  • p::Float64: Braiding probability (0 ≤ p ≤ 1)
  • state::Vector{ET}: Density matrix state in vectorized form
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.ladderbraidingsqmapMethod
ladderbraidingsqmap(::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 N
  • state::Vector{ET}: Density matrix state in vectorized form
  • idx::Int: Site index for braiding operation
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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
source
FibonacciChain.ladderrdmMethod
ladderrdm(::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 N
  • subsystems::Vector{Int64}: Indices of subsystem sites to trace out
  • state::Vector{ET}: Full density matrix state in vectorized form
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Matrix{Float64}: Reduced density matrix of the subsystem

For ladder systems where both subsystems have equal dimensions.

source
FibonacciChain.laddertranslationmapMethod
laddertranslationmap(::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 N
  • state::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.

source
FibonacciChain.mapst_sec2totMethod
mapst_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 N
  • state::Vector{ET}: State vector in symmetric sector Hilbert space
  • anyon_type::Symbol=:Fibo: anyon type

Returns

  • Vector{ET}: Total space state vector
source
FibonacciChain.measure_basismapMethod
measure_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 parameter
  • state::T: Input basis state
  • i::Int: Measurement site index (1 ≤ i ≤ N)
  • sign::Int64: Measurement outcome (0 for +, 1 for -)
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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
source
FibonacciChain.measurement_enumerationMethod
measurement_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

source
FibonacciChain.measurement_operator_mpsMethod
measurement_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 indices
  • i::Int: Measurement site
  • τ::Float64: Evolution time parameter
  • sign::Int64: Measurement outcome (0 or 1)
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • ITensor: Local measurement operator incorporating neighboring site correlations
source
FibonacciChain.mps_boundary_measureMethod
mps_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.

source
FibonacciChain.mps_measurement_enumerationMethod
mps_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.

source
FibonacciChain.ref_correlationMethod
ref_correlation(N::Int64, state_addref3::Vector{ET}; pbc::Bool=true, anyon_type::Symbol=:Fibo) where {ET}

Calculate spatio-temporal correlation using state with three reference qubits.

Arguments

  • N::Int64: System size
  • state_addref3::Vector{ET}: Quantum state with three reference qubits added
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Float64: Spatio-temporal correlation measure between two any spacetime points.

Uses reference qubit protocol to measure spatio-temporal correlations at two any spacetime points.

source
FibonacciChain.reference_evolutionMethod
reference_evolution(τ, forward, sample, site, t₁, t₂; pbc=true, anyon_type::Symbol=:Fibo, temp::Bool=false)

Compute temporal correlation between two time slices using cached forward evolution.

Arguments

  • τ: Evolution time parameter
  • forward: Cached forward state evolution trajectory
  • sample: Measurement sample configuration
  • x₂: Site index for reference qubit insertion
  • t₁: First time slice index
  • t₂: Second time slice index (must be >= t₁)
  • x₁::Int=1: Spatial site index for first reference qubit
  • pbc=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: anyon type
  • temp::Bool=false: Return trajectory if true
  • verbose::Bool=false: Enable verbose output

Returns

  • Reference qubit added state between specified time slices

Avoids redundant computation by reusing forward evolution results.

source
FibonacciChain.reference_generate_stateMethod
reference_generate_state(N::Int64, τ::Float64, state::Vector{ET}, sample; pbc::Bool=true, temp::Bool=true, k_old::Int64=1, anyon_type::Symbol=:Fibo) where {ET}

Generate quantum state evolution under measurement protocol with reference qubits.

Arguments

  • N::Int64: System size
  • τ::Float64: Evolution time parameter
  • state::Vector{ET}: Initial quantum state with reference qubits
  • sample: Measurement sample configuration
  • pbc::Bool=true: Periodic boundary conditions
  • temp::Bool=true: Return trajectory if true, final state if false
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Vector{ET} or trajectory: Evolved state or time evolution trajectory

Examples

julia> using FibonacciChain, Random, LinearAlgebra

julia> N = 4;

julia> initial_state = normalize!(ones(Float64, length(anyon_basis(N))));

julia> add_ref = add_reference_qubits!(N, initial_state, 1, verbose=false);

julia> Random.seed!(42);

julia> sample = ones(Int, 2, 2);

julia> τ = 0.5;

julia> trajectory = reference_generate_state(τ, add_ref, sample, temp=true);

julia> length(trajectory) == size(sample, 1)
true
source
FibonacciChain.spatial_correlationMethod
spatial_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 size
  • state::Union{Vector{ET}, Matrix{ET}}: Quantum state vector or density matrix
  • site1::Int64: First site index (1 ≤ site1 ≤ N)
  • site2::Int64: Second site index (1 ≤ site2 ≤ N, site2 ≠ site1)
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_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.

source
FibonacciChain.temporal_correlationMethod
temporal_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 size
  • state_addref2::Vector{ET}: Quantum state with two reference qubits added
  • pbc::Bool=true: Periodic boundary conditions
  • anyon_type::Symbol=:Fibo: Model type

Returns

  • Float64: Temporal correlation measure between time slices

Uses reference qubit protocol to measure temporal correlations at single site.

source
FibonacciChain.topological_symmetry_basismapMethod
topological_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 configuration
  • pbc::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
source
FibonacciChain.translation_matrixMethod
translation_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
source

Index