Internals
These functions and types are not exported (they are accessible as QuantumAlgebra.name). They mostly form the internal interface of the package and should not be relevant to most users, apart from the settings (e.g., use_σpm, auto_normal_form and use_bracket_display) and some functions to inspect or modify expressions (e.g., replace_inds and is_normal_form).
QuantumAlgebra.AbstractLindbladTermQuantumAlgebra.BaseOpProductQuantumAlgebra.BaseOpTypeQuantumAlgebra.BaseOperatorQuantumAlgebra.DeltaViewQuantumAlgebra.IndexFunctionQuantumAlgebra.IndexViewQuantumAlgebra.ItemSeqQuantumAlgebra.MixedLindbladTermQuantumAlgebra.OpFamilyQuantumAlgebra.OpPartitionQuantumAlgebra.OpProductQuantumAlgebra.ParamQuantumAlgebra.QuEqSysQuantumAlgebra.QuExprConstructorQuantumAlgebra.QuExprCstrctArrAliasQuantumAlgebra.QuIndexQuantumAlgebra.QuOpNameQuantumAlgebra.QuTermQuantumAlgebra.QuditVariableQuantumAlgebra.SOVariableQuantumAlgebra.SingleLindbladTermQuantumAlgebra.SummedLindbladTermQuantumAlgebra.UNVariableQuantumAlgebra.WorkTermQuantumAlgebra._COWDictQuantumAlgebra.replace_indsQuantumAlgebra.δQuantumAlgebra.BosonCreateQuantumAlgebra.BosonDestroyQuantumAlgebra.CorrPerm_islessQuantumAlgebra.CorrTup_islessQuantumAlgebra.FermionCreateQuantumAlgebra.FermionDestroyQuantumAlgebra.TLSCreateQuantumAlgebra.TLSDestroyQuantumAlgebra.TLSxQuantumAlgebra.TLSyQuantumAlgebra.TLSzQuantumAlgebra._canonicalize_sumindsQuantumAlgebra._encode_termQuantumAlgebra._reorder_sumindsQuantumAlgebra._spin_dimQuantumAlgebra._suminds_canonicalQuantumAlgebra._suminds_signaturesQuantumAlgebra.auto_normal_formQuantumAlgebra.baresQuantumAlgebra.commutesQuantumAlgebra.contract!QuantumAlgebra.corrheisQuantumAlgebra.corrsQuantumAlgebra.deltasQuantumAlgebra.exchange!QuantumAlgebra.expheisQuantumAlgebra.expval2corrs_indsQuantumAlgebra.expvalsQuantumAlgebra.extindicesQuantumAlgebra.hasindQuantumAlgebra.indsQuantumAlgebra.is_normal_formQuantumAlgebra.isintindexQuantumAlgebra.issumindexQuantumAlgebra.ladderQuantumAlgebra.lindbladtermQuantumAlgebra.lookahead_contractionQuantumAlgebra.lookahead_exchangeQuantumAlgebra.lookahead_meetQuantumAlgebra.make_indicesQuantumAlgebra.maybe_same_siteQuantumAlgebra.normal_order!QuantumAlgebra.nsumindsQuantumAlgebra.num_exprQuantumAlgebra.numlatexQuantumAlgebra.numstringQuantumAlgebra.op_adjointQuantumAlgebra.opextraQuantumAlgebra.opfamilyQuantumAlgebra.opnameQuantumAlgebra.opsQuantumAlgebra.opsymbolQuantumAlgebra.optypeQuantumAlgebra.paramsQuantumAlgebra.parstateQuantumAlgebra.qudit_levelsQuantumAlgebra.qudit_opQuantumAlgebra.set_define_default_opsQuantumAlgebra.set_quindices_typeQuantumAlgebra.simplify_numberQuantumAlgebra.site_deltasQuantumAlgebra.so_generatorQuantumAlgebra.so_opQuantumAlgebra.spin_jQuantumAlgebra.split_by_indQuantumAlgebra.sumindexQuantumAlgebra.symmetric_index_numsQuantumAlgebra.un_generatorQuantumAlgebra.un_opQuantumAlgebra.use_bracket_displayQuantumAlgebra.use_σpmQuantumAlgebra.use_σxyzQuantumAlgebra.using_auto_normal_formQuantumAlgebra.using_bracket_displayQuantumAlgebra.using_σpmQuantumAlgebra.vacuum_eigenvalue_leftQuantumAlgebra.vacuum_eigenvalue_rightQuantumAlgebra.ϵ_ab
QuantumAlgebra.OpProduct — Typeany (stored or mutable) product of operators
QuantumAlgebra.AbstractLindbladTerm — TypeAbstractLindbladTermA Lindblad term of a master equation (see heisenberg_eom), which is applied to an operator A by calling it, L(A). The subtypes are SingleLindbladTerm, MixedLindbladTerm and SummedLindbladTerm; they are created from the tuples that describe them with lindbladterm.
QuantumAlgebra.BaseOpProduct — TypeBaseOpProduct(v::Vector{BaseOperator})A product of operators stored as a vector that can be modified (e.g., while normal ordering). Inside the terms of an expression, products of operators are stored compactly together with the rest of the term (see QuTerm).
QuantumAlgebra.BaseOpType — TypeBaseOpTypeThe type of a BaseOperator, e.g., BosonCreate_ or TLSz_. Operators are ordered by their type (in the order of the values of BaseOpType), then by name, additional data and indices. Normal ordering brings products of operators into this order as far as their algebra allows, so that, e.g., creation operators end up to the left of annihilation operators.
QuantumAlgebra.BaseOperator — TypeBaseOperatorA single operator in a term, given by its type (see BaseOpType), its name, its indices, and additional data for some kinds of operators (e.g., the levels of a qudit transition, or the value of a spin). Operators are usually not created directly, but with the macros that define operators (e.g., @boson), which give QuExpr objects. For bosons, fermions and two-level systems, BaseOperators can also be created with BosonDestroy(name, inds...), BosonCreate(name, inds...), FermionDestroy, FermionCreate, TLSDestroy, TLSCreate, TLSx, TLSy and TLSz (e.g., BosonCreate(:a, :i) is $a_i^†$).
QuantumAlgebra.DeltaView — TypeDeltaView: the Kronecker deltas of a term (a read-only view into its storage)
QuantumAlgebra.IndexFunction — TypeIndexFunctionA function that maps indices to indices (f(ind::QuIndex)), which can then be applied to operators, parameters, terms and expressions to change their indices (e.g., replace_inds).
QuantumAlgebra.IndexView — TypeIndexView: the indices of an operator or parameter (a read-only view into its storage)
QuantumAlgebra.ItemSeq — TypeItemSeq{T}: n consecutive items of type T (stored in nw words starting at w[off])
QuantumAlgebra.MixedLindbladTerm — TypeMixedLindbladTerm(γ, (L1, L2))The "mixed" Lindblad term with rate γ and two operators L1 and L2, which gives the symmetrized $\frac{1}{2} [γ (L_2^† A L_1 - \frac{1}{2} \{L_2^† L_1, A\}) + γ^* (L_1^† A L_2 - \frac{1}{2} \{L_1^† L_2, A\})]$ in the equation of motion of an operator $A$.
QuantumAlgebra.OpFamily — TypeOpFamilyThe family of an operator (bosons, fermions, two-level systems, qudits, spins, or generators of so(n) or u(n), see opfamily). Operators of different families always commute, and the algebra within a family F is defined by methods of exchange!, contract! and commutes with the first argument ::Val{F} (see the comments at the beginning of src/operator_rules.jl), together with ladder, vacuum_eigenvalue_right, op_adjoint, opsymbol, lookahead_contraction, lookahead_meet and lookahead_exchange, which have default methods.
QuantumAlgebra.OpPartition — TypeOpPartition: a partition of operators 1:N into groups, each given by the (sorted) indices of the operators in it
QuantumAlgebra.Param — TypeParamA parameter in a term, given by its name, its state ('r' for a real parameter, 'n' for a complex parameter, and 'c' for the complex conjugate of a complex parameter) and its indices. Parameters are defined with @qparam or qparam (or, in the legacy interface, with param and the string macros @Pr_str and @Pc_str).
QuantumAlgebra.QuEqSys — TypeQuEqSysA system of equations of motion for expectation values (QuEqSys{ExpVal}) or correlators (QuEqSys{Corr}), as returned by heisenberg_eom_system. EQ.eqs is an ordered dictionary from the expectation values (or correlators) to the right-hand sides of their equations, EQ[k] is the right-hand side of the k-th equation, and EQ[A] the one for the operator A (e.g., EQ[a] for $⟨a⟩$) or the expectation value (or correlator) A. The system is printed as the list of equations, and can be converted to LaTeX with latex.
QuantumAlgebra.QuExprConstructor — TypeQuExprConstructorA callable object that creates operators (or parameters) as QuExprs, e.g., a in a(:i) for the operators of the legacy interface (see boson_ops). Its adjoint a' creates the adjoint operators. The variables of operators with indices (e.g., a after @boson a[:], see QuExprCstrctArrAlias) call it with the indices.
QuantumAlgebra.QuExprCstrctArrAlias — TypeQuExprCstrctArrAliasThe variable of an operator or parameter with indices, e.g., a after @boson a[:,:] (or a = boson(:a; ndims=2)): indexing it with the declared number of indices gives the operator with these indices, a[i,j], and its adjoint a' is the variable of the adjoint operator, a'[i,j]. It is also used for indices with a subindex, e.g., j after @qindex j[:] (with j[2] giving j₂).
QuantumAlgebra.QuIndex — TypeQuIndex(i)An index of an operator or parameter: an integer (QuIndex(2)), a symbolic index, given by a single unicode character with an optional integer subindex (QuIndex(:i), or QuIndex(:j_2) and QuIndex("j_2"), printed as j₂), or a summation index (see sumindex).
Indices are usually not created directly: operators and parameters accept integers and symbols as indices (e.g., a[:i,2]), or index variables defined with @qindex (e.g., a[i,j[2]]).
See also isintindex, issumindex.
QuantumAlgebra.QuOpName — TypeQuOpName(name::Symbol)The name of an operator or parameter. Names are stored as integer ids into a global table of names, so that they can be compared and hashed quickly, and they are ordered alphabetically.
QuantumAlgebra.QuTerm — TypeQuTermRepresents a single term in a quantum algebra expression.
A term consists of:
- Sum indices (summed-over indices)
- Delta functions
- Parameters
- Expectation values
- Correlators/cumulants
- Bare operators
See also
QuantumAlgebra.QuditVariable — TypeQuditVariableA qudit created by qudit or @qudit: q(i,j) is the transition operator $|i⟩⟨j|$ (for a qudit with indices, an object that is indexed with the indices, q(i,j)[k]), and q(M) the operator with matrix M, $\sum_{ij} M_{ij} |i⟩⟨j|$ (or q(M)[k]).
QuantumAlgebra.SOVariable — TypeSOVariableThe generators of so(n) created by so or @so: L(a,b) is the generator $L_{ab}$ (for generators with indices, an object that is indexed with the indices, L(a,b)[k]).
QuantumAlgebra.SingleLindbladTerm — TypeSingleLindbladTerm(γ, L)The Lindblad term with rate γ and jump operator L, which gives $γ (L^† A L - \frac{1}{2} \{L^† L, A\})$ in the equation of motion of an operator $A$.
QuantumAlgebra.SummedLindbladTerm — TypeSummedLindbladTerm(inds, L)The sum of the Lindblad term L (a SingleLindbladTerm or MixedLindbladTerm) over the indices inds, e.g., $\sum_i γ (σ^+_i A σ^-_i - \frac{1}{2} \{σ^+_i σ^-_i, A\})$.
QuantumAlgebra.UNVariable — TypeUNVariableThe generators of u(n) created by un or @un: S(a,b) is the generator $S_{ab}$ (for generators with indices, an object that is indexed with the indices, S(a,b)[k]).
QuantumAlgebra.WorkTerm — TypeWorkTermMutable working form of a QuTerm used while normal ordering. All vectors are owned by the WorkTerm and can be modified freely. Convert back with QuTerm(w::WorkTerm).
QuantumAlgebra._COWDict — Type_COWDict{K,V}()A dictionary that can be read from several threads without locking. It is never modified in place, but replaced as a whole (under a lock) when entries are added, so it is only meant for small tables (such as caches with few entries).
QuantumAlgebra.replace_inds — Typereplace_inds(old => new, …)The index function (see IndexFunction) that replaces the indices old by new, which can be applied to expressions, e.g., replace_inds(QuIndex(:i) => QuIndex(:k))(g[:i]*b[:i]*b'[:j]) gives g(k) b(k) b†(j).
QuantumAlgebra.δ — Typeδ(iA, iB)The Kronecker delta $δ_{iA,iB}$ of two indices in a term. It is only stored for two different indices that can be equal (i.e., not for two different integers). Kronecker deltas appear, e.g., when normal ordering, such as in normal_form(b[:i]*b'[:j]), which gives δ(ij) + b†(j) b(i).
δ(Ainds, Binds), with two vectors of indices, returns the Kronecker deltas for the pairwise equality of Ainds and Binds (only for pairs of different indices), or nothing if not all of them can be equal.
QuantumAlgebra.BosonCreate — MethodBosonCreate(name,inds): represent bosonic creation operator $name_{inds}$
QuantumAlgebra.BosonDestroy — MethodBosonDestroy(name,inds): represent bosonic annihilation operator $name_{inds}$
QuantumAlgebra.CorrPerm_isless — MethodCorrPerm_isless(a,b)isless for Tuples of Tuples representing products of Corr (see above) of a permutation of operators. E.g., ((1,3),(2,)) represents <A1 A3>C <A2>C. It is assumed that the total number of operators in a and b is equal, i.e., that sum(length.(a)) == sum(length.(b)).
QuantumAlgebra.CorrTup_isless — MethodCorrTup_isless(a,b)isless for Tuples of integers that represent Corr of sorted operators (with n representing An such that n<m == An<Am). (n,m,...) ≡ Corr(AnAm...). Defined in such a way that the same order is obtained as with BaseOperator objects
QuantumAlgebra.FermionCreate — MethodFermionCreate(name,inds): represent fermionic creation operator $name_{inds}$
QuantumAlgebra.FermionDestroy — MethodFermionDestroy(name,inds): represent fermionic annihilation operator $name_{inds}$
QuantumAlgebra.TLSCreate — MethodTLSCreate(name,inds): represent TLS creation operator $name_{inds}$
QuantumAlgebra.TLSDestroy — MethodTLSDestroy(name,inds): represent TLS annihilation operator $name_{inds}$
QuantumAlgebra.TLSx — MethodTLSx(name,inds): represent TLS x operator $name_{inds}$
QuantumAlgebra.TLSy — MethodTLSy(name,inds): represent TLS y operator $name_{inds}$
QuantumAlgebra.TLSz — MethodTLSz(name,inds): represent TLS z operator $name_{inds}$
QuantumAlgebra._canonicalize_suminds — Method_canonicalize_suminds(t::QuTerm)Renumber the sum indices of the normal-ordered term t canonically. Returns (tc, sign, isnormal) such that t = sign*tc, where isnormal is true if tc is in normal form, or nothing if the term vanishes (because renumbering gives the same term with opposite sign).
QuantumAlgebra._encode_term — Method_encode_term(nsuminds, δs, params, expvals, corrs, bares, fδ, f)Create a QuTerm from its parts. Each part is a tuple of collections whose concatenation gives the respective part of the term. The index function fδ is applied to the indices of the δs and f to all other indices (nothing stands for no change). Index functions are applied in the order in which the indices are stored, i.e., δs, params, expvals, corrs, bares.
QuantumAlgebra._reorder_suminds — Method_reorder_suminds(t::QuTerm): renumber the sum indices of t in the order in which they appear (returns t if that is already the case)
QuantumAlgebra._spin_dim — Method_spin_dim(A): the dimension 2j+1 of the representation of the spin operator A, or nothing if j is not a fixed number
QuantumAlgebra._suminds_canonical — Method_suminds_canonical(t::QuTerm): whether the sum indices of the normal-ordered term t are numbered canonically
QuantumAlgebra._suminds_signatures — Method_suminds_signatures(t::QuTerm): signatures of the sum indices of t that do not depend on their numbering
QuantumAlgebra.auto_normal_form — Functionauto_normal_form(t::Bool=true; set_preference=false)Enable (or disable, with t = false) automatic normal ordering, which brings every expression into normal form when it is created (e.g., a*a' then directly gives 1 + a†() a()). It is disabled by default, so that normal_form has to be called explicitly. If set_preference is true, the choice is stored with Preferences.jl (preference "auto_normal_form") for future sessions.
QuantumAlgebra.bares — Methodbares(t::QuTerm): the product of "bare" operators (outside expectation values) in the term
QuantumAlgebra.commutes — Methodcommutes(A, B): whether operators A and B commute.
QuantumAlgebra.contract! — Methodcontract!(emit, A, B): simplify the product A B. Returns nothing if it does not simplify, or (fac, op) with A B = fac op + R (see exchange! for R).
QuantumAlgebra.corrheis — Methodcorrheis(A, H, Ls=())Return the right-hand side of the equation of motion of the correlator (cumulant) $⟨A⟩_c$ of a product of operators A (or for a correlator A), expressed through correlators. The results are cached, so that the equations of the correlators that appear in the equations of higher-order correlators are only calculated once.
QuantumAlgebra.corrs — Methodcorrs(t::QuTerm): the correlators Corr in the term
QuantumAlgebra.deltas — Methoddeltas(t::QuTerm): the Kronecker deltas δ in the term
QuantumAlgebra.exchange! — Methodexchange!(emit, B, A): rewrite B A = x A B + R, with A < B. Passes the terms of R to emit(c, δs, ops...) and returns x.
QuantumAlgebra.expheis — Methodexpheis(A, H, Ls=())Return the right-hand side of the equation of motion of the expectation value $⟨A⟩$ (for an expectation value A or an expression of operators), i.e., the expectation value of the normal form of heisenberg_eom(A, H, Ls).
QuantumAlgebra.expval2corrs_inds — Methodexpval2corrs_inds(N::Int)for N operators, create an array of partitions (see OpPartition) that represents the terms in a sum of products of correlators. Each partition corresponds to a sum term. Internally, they are computed as tuples of tuples, see CorrTup_isless and CorrPerm_isless for details. The returned array and terms are sorted such that if the N operators are sorted, the represented expression is also sorted with the conventions of the QuantumAlgebra package. This allows to directly return a normal-ordered form.
QuantumAlgebra.expvals — Methodexpvals(t::QuTerm): the expectation values ExpVal in the term
QuantumAlgebra.extindices — Methodextindices(A) return externally visible indices of an expression
QuantumAlgebra.hasind — Methodhasind(ind::QuIndex, A)Return whether the index ind appears in A (a Kronecker delta, an operator, a parameter, a product of operators, an expectation value or a correlator).
QuantumAlgebra.inds — Methodinds(A): the indices of an operator or parameter
QuantumAlgebra.is_normal_form — Methodis_normal_form(A)Return whether A (a QuExpr, a term, or a product of operators) is in normal form, i.e., whether normal_form(A) == A (see normal_form).
QuantumAlgebra.isintindex — Methodisintindex(i::QuIndex)Check if the index i is an integer index (created with QuIndex(i::Integer)).
QuantumAlgebra.issumindex — Methodissumindex(i::QuIndex)Check if the index i is a summation index (created with sumindex(i)).
QuantumAlgebra.ladder — Methodladder(A): +1 for a creation operator, -1 for an annihilation operator, and 0 for other operators.
QuantumAlgebra.lindbladterm — Methodlindbladterm(args...)Return the Lindblad term described by args (see heisenberg_eom): lindbladterm(L) and lindbladterm(γ, L) give a SingleLindbladTerm (with γ = 1 if it is not given), lindbladterm((L1, L2)) and lindbladterm(γ, (L1, L2)) a MixedLindbladTerm, and with an index or a tuple of indices as the first argument, e.g., lindbladterm(:i, γ, L), the sum of the term over these indices (SummedLindbladTerm).
QuantumAlgebra.lookahead_contraction — Methodlookahead_contraction(A): whether A can contract with an operator that is not next to it in normal order (e.g., σˣ₁ in σˣ₁ σˣ₂ σʸ₁), if the operators in between commute with the later one.
QuantumAlgebra.lookahead_exchange — Methodlookahead_exchange(A): whether (for lookahead_contraction) the later operator can also be moved past operators in between that it does not commute with (which gives additional terms with their commutators), so that operators that can contract are always contracted.
QuantumAlgebra.lookahead_meet — Methodlookahead_meet(A): whether (for lookahead_contraction) the operators in between can also commute with A instead, so that the two operators meet in between.
QuantumAlgebra.make_indices — Methodmake_indices(inds...): convert the arguments (or a single tuple or vector of them) to a vector of QuIndex
QuantumAlgebra.maybe_same_site — Methodmaybe_same_site(A, B): whether the operators A and B can act on the same mode, i.e., have the same name and indices that can all be equal.
QuantumAlgebra.normal_order! — Functionnormal_order!(ops::BaseOpProduct, term_collector, shortcut_vacA_zero=false, prefactor=1)Bring the operator product ops into normal order in place. Returns the prefactor p of the reordered product, such that the original prefactor*ops is equal to p*ops (after reordering) plus the terms that are added to term_collector (which still have to be normal ordered).
QuantumAlgebra.nsuminds — Methodnsuminds(t::QuTerm): number of summation indices in the term
QuantumAlgebra.num_expr — Methodnum_expr(x::Number)The Julia expression for the coefficient x in julia_expression, which is a Float64 or a ComplexF64 by default. Packages that provide other number types (e.g., symbolic numbers) can add methods for them.
QuantumAlgebra.numlatex — Methodnumlatex(x)The object that is passed to Latexify for the coefficient x of a term in LaTeX output (x itself by default). Packages that provide other number types (e.g., symbolic numbers) can add methods for them, e.g., to put sums in parentheses.
QuantumAlgebra.numstring — Methodnumstring(x::Number)The string for printing the coefficient x of a term. Packages that provide other number types (e.g., symbolic numbers) can add methods for them, e.g., to put sums in parentheses.
QuantumAlgebra.op_adjoint — Methodop_adjoint(A): the adjoint of the operator A.
QuantumAlgebra.opextra — Methodopextra(A::BaseOperator): additional (family-specific) information stored with an operator
QuantumAlgebra.opfamily — Methodopfamily(A): the OpFamily of the operator A (or of the operator type A::BaseOpType).
QuantumAlgebra.opname — Methodopname(A): the name (as a QuOpName) of an operator or parameter
QuantumAlgebra.ops — Methodops(A::Union{ExpVal,Corr}): the product of operators inside the expectation value or correlator
QuantumAlgebra.opsymbol — Methodopsymbol(A, style): the symbol that is appended to the name of the operator A when printing it, for style :text, :expr (in julia_expression) or :latex.
QuantumAlgebra.optype — Methodoptype(A::BaseOperator): the BaseOpType of an operator
QuantumAlgebra.params — Methodparams(t::QuTerm): the parameters Param in the term
QuantumAlgebra.parstate — Methodparstate(A::Param): one of 'r' (real), 'n' (normal/complex) or 'c' (complex conjugate)
QuantumAlgebra.qudit_levels — Methodqudit_levels(A): (d,i,j) for a qudit operator A = |i⟩⟨j| (with i == 1 or j == 1) of a d-level system
QuantumAlgebra.qudit_op — Methodqudit_op(name, d, i, j, inds): the operator |i⟩⟨j| of a d-level system, with either i == 1 or j == 1 (but not both)
QuantumAlgebra.set_define_default_ops — Methodset_define_default_ops(t::Bool)Set the preference "define_default_ops", which determines whether the default operators of the legacy interface (a, adag, f, fdag, σx, σy, σz, σp, σm) are defined when QuantumAlgebra is loaded (the default is true). The default operators are deprecated and will be removed in version 2.0; define operators with the macros instead (e.g., @boson a[:], see @boson).
Changing this preference requires restarting the Julia session to take effect.
QuantumAlgebra.set_quindices_type — Methodset_quindices_type(t::String)Deprecated: indices are now always stored in a compact form that supports an arbitrary number of indices, so the "quindices_type" preference no longer has any effect.
QuantumAlgebra.simplify_number — Methodsimplify_number(x::Number)Simplify the coefficient x of a term when it is stored in a QuExpr (by default, floating-point numbers with integer values are converted to integers). Packages that provide other number types can add methods for them.
QuantumAlgebra.site_deltas — Methodsite_deltas(A, B): the Kronecker deltas that make the operators A and B act on the same mode (only for maybe_same_site(A, B)).
QuantumAlgebra.so_generator — Methodso_generator(A): (n,a,b) for the generator A = L_ab (with a < b) of so(n)
QuantumAlgebra.so_op — Methodso_op(name, n, a, b, inds): the generator L_ab of so(n), with a < b
QuantumAlgebra.spin_j — Methodspin_j(A): the spin j of the spin operator A, or nothing if it is not fixed
QuantumAlgebra.split_by_ind — Methodsplit_by_ind(ind::QuIndex, v)Split the collection v (e.g., of operators or parameters) into the elements that do not contain the index ind and those that do (see hasind), and return both.
QuantumAlgebra.sumindex — Methodsumindex(i)Return the summation index number i (printed as #ᵢ). Sums (see ∑) are stored with summation indices for the indices that are summed over, so that they cannot clash with other indices.
QuantumAlgebra.symmetric_index_nums — Methodsymmetric_index_nums(A) return sequence of numbers of exchange-symmetric indices
QuantumAlgebra.un_generator — Methodun_generator(A): (a,b) for the generator A = S_ab of u(n)
QuantumAlgebra.un_op — Methodun_op(name, a, b, inds): the generator S_ab of u(n)
QuantumAlgebra.use_bracket_display — Functionuse_bracket_display(t::Bool=true; set_preference=false)Select whether operators and parameters are printed in the syntax of the interface with operator variables (see @boson), e.g., a†[i,j], g[i] and a (for true), or with parentheses, e.g., a†(ij), g(i) and a() (for false, the default in v1.x). If set_preference is true, the choice is stored with Preferences.jl for future sessions.
QuantumAlgebra.use_σpm — Functionuse_σpm(t::Bool=true; set_preference=false)Choose how the operators of two-level systems are represented: with the raising and lowering operators $σ^+$ and $σ^-$ (for true), or with the Pauli matrices $σ^x$, $σ^y$ and $σ^z$ (for false, the default). This applies to the operators that are created afterwards, e.g., σ[i] after @tls σ[:] (or σx after @tlsxyz σ, which is created when it is defined), which are then expressed in the chosen basis. If set_preference is true, the choice is stored with Preferences.jl (preference "use_σpm") for future sessions.
QuantumAlgebra.use_σxyz — Methoduse_σxyz(; set_preference=false)Represent the operators of two-level systems with the Pauli matrices $σ^x$, $σ^y$ and $σ^z$ (the default), equivalent to use_σpm(false; set_preference) (see use_σpm).
QuantumAlgebra.using_auto_normal_form — Methodusing_auto_normal_form()Return whether automatic normal ordering is enabled (see auto_normal_form).
QuantumAlgebra.using_bracket_display — Methodusing_bracket_display()Return whether operators are printed in the syntax with brackets (see use_bracket_display).
QuantumAlgebra.using_σpm — Methodusing_σpm()Return whether the operators of two-level systems are represented with $σ^+$ and $σ^-$ (see use_σpm).
QuantumAlgebra.vacuum_eigenvalue_left — Methodvacuum_eigenvalue_left(A): λ if $⟨0|A = λ⟨0|$ (including λ = 0), and nothing otherwise.
QuantumAlgebra.vacuum_eigenvalue_right — Methodvacuum_eigenvalue_right(A): λ if $A|0⟩ = λ|0⟩$ (including λ = 0), and nothing otherwise.
QuantumAlgebra.ϵ_ab — Methodϵ_ab(A,B): for Pauli matrices σᵃ, σᵇ (with a≠b), return the third one, σᶜ, and the Levi-Civita symbol ϵ_abc