Operators
Operators in Schwinger.jl are represented by the abstract type SchwingerOperator, with three concrete types:
EDOperator: an operator represented as a matrix for its action on a basis ofBasisStatesITensorOperator: a matrix product operator usingITensorMPS.jlMPSKitOperator: a matrix product operator usingMPSKit.jl
Unified API
Like the Hamiltonian, other operators can be constructed using the unified API with the backend keyword:
W = WilsonLoop(lattice; backend=:ED)
W = WilsonLoop(lattice; backend=:ITensors)
W = WilsonLoop(lattice; backend=:MPSKit)We can evaluate the expectation of an operator in a state:
using Schwinger
lat = Lattice(10; F = 1, )
gs = groundstate(Hamiltonian(lat; backend=:ED))
sum(electricfields(gs))/10, expectation(AverageElectricField(lat; backend=:ED), gs)(-0.06311875619670917, -0.06311875619670704 + 1.7347234759768063e-18im)This can also be carried out manually by acting on the state with the operator:
using LinearAlgebra
dot(gs, AverageElectricField(lat; backend=:ED) * gs)-0.06311875619670707 + 1.734723475976807e-18imSchwinger.expectation — Function
expectation(op, state)
Return the expectation value of the operator op in state.
Arguments
op::EDOperator`: operator.state::EDState: state.
expectation(op, state)
Return the expectation value of the operator op in state.
Arguments
op::ITensorOperator`: operator.state::ITensorState: state.
expectation(op, state)
Return the expectation value of the operator op in state.
Arguments
op::MPSKitOperator`: operator.state::MPSKitState: state.
Schwinger.act — Function
act(op, state)
Apply the operator op to the state state.
Arguments
op::ITensorOperator: operator.state::ITensorState: state.
act(op, state)
Apply the operator op to the state state.
Arguments
op::EDOperator: operator.state::EDState: state.
act(op, state)
Apply the operator op to the state state.
Arguments
op::MPSKitOperator: operator.state::MPSKitState: state.
Exact diagonalization
Schwinger.EDWilsonLoop — Function
wilsonloop(hamiltonian, conjugate = false)
Returns the spatial Wilson loop operator for lattice.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson loop.
Schwinger.EDWilsonLine — Function
EDWilsonLine(lattice, conjugate = false, flavor = 1, start = 1, finish = N)
Returns the spatial Wilson line operator for lattice.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson line.flavor::Int: Flavor of the Wilson line.start::Int: Starting site of the Wilson line.finish::Int: Finishing site of the Wilson line.
Schwinger.EDAverageElectricField — Function
EDAverageElectricField(lattice; power = 1, L_max = nothing, universe = 0)
Construct an EDOperator that computes the average electric field (raised to some power).
Arguments
lattice::Lattice: The lattice to compute the average electric field on.power::Int=1: The power to raise the electric field to.L_max::Union{Nothing,Int}=nothing: The maximum absolute value of L₀.universe::Int=0: The universe to compute the average electric field in.sitelist::Union{Nothing,Vector{Int}}=nothing: List of sites to average over.
ITensors operators
Schwinger.ITensorWilsonLoop — Function
ITensorWilsonLoop(lattice, conjugate = false)
Returns the spatial Wilson loop operator for lattice.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson loop.
Schwinger.ITensorWilsonLine — Function
ITensorWilsonLine(lattice, conjugate = false, flavor = 1, start = 1, finish = N)
Returns the spatial Wilson line operator for lattice.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson line.flavor::Int: Flavor of the Wilson line.start::Int: Starting site of the Wilson line.finish::Int: Finishing site of the Wilson line.
Schwinger.ITensorAverageElectricField — Function
ITensorAverageElectricField(lattice; power = 1, L_max = nothing, universe = 0)
Construct an ITensorOperator that computes the average electric field (raised to some power).
Arguments
lattice::Lattice: The lattice to compute the average electric field on.power::Int=1: The power to raise the electric field to.L_max::Union{Nothing,Int}=nothing: The maximum absolute value of L₀.universe::Int=0: The universe to compute the average electric field in.sitelist::Union{Nothing,Vector{Int}}=nothing: List of sites to average over.
MPSKit operators
Schwinger.MPSKitWilsonLoop — Function
MPSKitWilsonLoop(lattice, conjugate = false)
Returns the spatial Wilson loop operator for lattice using MPSKit.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson loop.
Schwinger.MPSKitWilsonLine — Function
MPSKitWilsonLine(lattice, conjugate = false, flavor = 1, start = 1, finish = N)
Returns the spatial Wilson line operator for lattice using MPSKit.
Arguments
lattice::Lattice: lattice.conjugate::Bool: Conjugation of the Wilson line.flavor::Int: Flavor of the Wilson line.start::Int: Starting site of the Wilson line.finish::Int: Finishing site of the Wilson line.
Schwinger.MPSKitAverageElectricField — Function
MPSKitAverageElectricField(lattice; power = 1, L_max = nothing, universe = 0)
Construct an MPSKitOperator that computes the average electric field (raised to some power).
Arguments
lattice::Lattice: The lattice to compute the average electric field on.power::Int=1: The power to raise the electric field to.universe::Int=0: The universe to compute the average electric field in.sitelist::Union{Nothing,Vector{Int}}=nothing: List of sites to average over.