Internals

Internals

Index of Commands

abstract_operators.jl

ED_sectors.SOPType.
SOP(name,site)

A struct for storing a single-site operator. This is an internal method which users shouldn't have to access.

source
TERM_INTERNAL(prefactor, operator)

The internal representation of a term as a (generically complex) prefactor and an array of single-single operators called operator.

source
Base.:*Method.
*(x,TERM_INTERNAL)
x*TERM

Defined scalar multiplication of TERM's: the scalar acts on the prefactor.

source
parse_term(op, term)

Internal function to parse a TERM into an array of TERM_INTERNALs so they can be added onto an operator.

source
parse_term(op, term)

Internal function to parse the operators given in the TERM constructor into a Dictionary.

source

basis.jl

BASISVECTOR(conj_class, phase_factor)

A struct that links a basis vector to its conjugacy class `conjclass' and gives the phase factor 'phasefactor' between them due to the representation.

source
CONJCLASS(index,norm)

A struct that describes the conjugacy class of a basis element. With symmetries, each conjugacy class is associated to a basis vector. The index is the index of the associated basis vector and the norm is the norm squared of that conjugacy class, so it can be properly normalized.

source
ORBIT(norm, representative, elements)

A struct which stores the orbit of a single element under an Abelian group action.

source
check_same_basis_debug(basis1,basis2)

Checks if two bases are the same. UNTESTED! Use for debugging only.

source
get_valid_state_function(L, unitCellSize,, symmetries)

Returns a function states -> Bool that determines if a state is valid, i.e. satisfies the constraint imposed by the symmetry sector.

Arguments

  • 'L :: Int': length of the chain
  • 'unitCellSize:: Int' - size of the unit cell, must divide L
  • 'symmetries :: Dict{String,Int}': a dictionary of the symmetries and their sectors, e.g ["Sz"=> 2,"K"=>2]
source
make_Inversion_function(L,Inv,a)

Returns a function which computes the inversion (flip in the x-direction) of a state #Arguments

  • 'L :: Int': the number of sites
  • 'Inv :: Int': the Inversion sector, in {-1,1}
  • 'a :: Int': the size of the unit cell, must divide L
source
make_Z2A_function(L,Z2A)

Returns a function which computes a version of a state flipped on the B sublattice. This only makes sense when unitCellSize = 2, of course. #Arguments

  • 'L :: Int': the number of sites
  • 'Z2A :: Int': the Z2A sector, in {-1,1}
source
make_Z2B_function(L,Z2B)

Returns a function which computes a version of a state flipped on the B sublattice. This only makes sense when unitCellSize = 2, of course. #Arguments

  • 'L :: Int': the number of sites
  • 'Z2B :: Int': the Z2B sector, in {-1,1}
source
make_basis(L; [unitCellSize=a, syms=Symmetries_Dict, constraint=constraint_function])

Internal function to produce a basis from its size, constraints, and symmetry information.

Arguments

  • 'L :: Int': the number of sites
  • 'unitCellSize :: Int': the number of sites per unit cell
  • 'syms :: Dict{String,Int}': a dictionary of symmetries with their sector names, e.g. the translation sector 3 is "K" => 3
  • 'constraint :: Function': a function (state, L) -> bool to determine if a given state satisfies a constraint
source
make_easy_orbit_function(L,unitCellSize,symmetries)

Given the symmetry information, returns a function which computes the orbit of an individual element. Works for valid basis elements only.

Arguments

  • 'L :: Int': length of the chain
  • 'unitCellSize:: Int' - size of the unit cell, must divide L
  • 'symmetries :: Dict{String,Int}': a dictionary of the symmetries and their sectors, e.g ["Sz"=> 2,"K"=>2]
source
make_spin_flip_function(L,Z2)

Returns a function which computes the spin flip of a state #Arguments

  • 'L :: Int': the number of sites
  • 'Z2 :: Int': the Z2 sector, in {-1,1}
source
make_translation_function(L,a,K)

Returns a function which, given a state x and phase factor pf, gives the translated state T.x and new phase factor.

#Arguments

  • 'L :: Int': the number of sites
  • 'a :: Int': the number of sites per unit cell, must divide L
  • 'K :: Int': the translation symmetry sector, 0 <= K <= L
source
measure_N_up(s, L)

Measures the number of spin up's for a state 's' for 'L' spins. Returns the Sz sector of s, i.e. the number of spin's up.

source
measure_N_up_A(s, L)

Measures the number of spin up's for a state 's' for 'L' spins in the A sector, for an ABABAB sublattice structure. Returns the SzA sector of s.

source
measure_N_up_B(s, L)

Measures the number of spin up's for a state 's' for 'L' spins in the B sector, for an ABABAB sublattice structure. Returns the SzB sector of s.

source

matrix_constructors.jl

ED_sectors.VECType.
VEC(factor,state)

A type for storing a prefactor * basis_state.

source
apply_S_minus(v,i)

#Arguments *'v: VEC': a basis vector VEC(prefactor, state) *'i: Int': the index of the spin to apply the operator to, 0 <= i <= L

Given a basis vector |v>, return S_i^- |v>, which is another basis vector.

source
apply_S_plus(v,i)

Given a basis vector |v>, return S_i^+ |v>, which is another basis vector.

Arguments

  • 'v: VEC': a basis vector VEC(prefactor, state)
  • 'i: Int': the index of the spin to apply the operator to, 0 <= i <= L
source
apply_S_x(v,i)

Given a basis vector |v>, return S_i^x |v>, which is another basis vector.

Arguments

  • 'v: VEC': a basis vector VEC(prefactor, state)
  • 'i: Int': the index of the spin to apply the operator to, 0 <= i <= L
source
apply_S_y(v,i)

Given a basis vector |v>, return S_i^y |v>, which is another basis vector.

Arguments

  • 'v: VEC': a basis vector VEC(prefactor, state)
  • 'i: Int': the index of the spin to apply the operator to, 0 <= i <= L
source
apply_S_z(v,i)

Arguments

  • 'v: VEC': a basis vector VEC(prefactor, state)
  • 'i: Int': the index of the spin to apply the operator to, 0 <= i <= L

Given a basis vector |v>, return S_i^z |v>, which is another basis vector.

source
apply_operators(v,t)

Given a basis vector |v> and a term (i.e. operator) t, returns t | v>. For spin-1/2 with the X,Y,Z,+,- operators, the return vector is always another basis vector, rather than superposition thereof, which simplifies things.

Arguments

  • 'v::VEC': a vector VEC(prefactor,basis vector) to apply the term to
  • 't::TERM_INTERNAL': a single term from a Hamiltonian to apply
source
construct_matrix_fermion_biliners(basis, abstract_op)

Makes a Hamiltonian from fermion bilinears. Only work for number-conserving Hamiltonians

Argument s

  • 'basis :: Basis': the basis for the spin chain
  • 'abstract_op :: HAMILTONIAN': the abstract operator to implement
source
construct_matrix_full(basis, abstract_op)

An internal method to quickly make an operator for the full basis with no symmetry constraints.

source
construct_matrix_sym(basis, abstract_op)

Internal function to construct a Hamiltonian with symmetries.

source

Returns the correct Pauli matrix for the name. Really this should a hardcoded dictionary, but its essentially the same and there's not that many of them.

source
is_Null_VEC(vec)

Tests if 'vec' is the zero vector to numerical precision. Mostly used for internal testing.

source

measurement.jl

ground_state(H)

Returns a tuple (E0, psi0) of the ground state energy and wavefunction.

source

dynamics.jl

Function to compute a two-point function Tr[rho O(t)O(0)] at a list of times {t1,t2,...}.

source

Function to compute a two-point function <psi|O(t)O(0)|psi> at a list of times {t1,t2,...}. Since we're doing the same operator at each time, we can optimize this a bit.

source

Function to compute a two-point function <psi|O(t)O(0)|psi> for an eigenstate |psi> at a list of times {t1,t2,...}. Since we're doing the same operator at each time, we can optimize this a bit.

source

utilities.jl

Pretty printing for spin-1/2 states. #Arguments

  • 'psi :: Array{UInt64}': states to display
source