Skip to main content

NumberPotential

Overloads

NameDescription
NumberPotential(const List<real> coefficients) -> RealOperatorFermiParamReturns an operator representing a weighted sum of number operators i=0N1αini\sum_{i=0}^{N-1} \alpha_i n_i, where the site indices are implicitly 0,1,,N10, 1, \dots, N-1. If a subset of sites or a different ordering is desired, use the factory overload that accepts an explicit list of site indices.
NumberPotential(const List<real> coefficients, const List<integer> sites) -> RealOperatorFermiParamReturns an operator representing a weighted sum of number operators isitesαini\sum_{i \in \mathrm{sites}} \alpha_i n_i.

NumberPotential(const List<real> coefficients) -> RealOperatorFermiParam

Returns an operator representing a weighted sum of number operators i=0N1αini\sum_{i=0}^{N-1} \alpha_i n_i, where the site indices are implicitly 0,1,,N10, 1, \dots, N-1. If a subset of sites or a different ordering is desired, use the factory overload that accepts an explicit list of site indices.

Parameters

  • coefficients: The coefficients αi\alpha_i.

Example

var coefficients = [1.0,3.0,4.0,0.0]
NumberPotential(coefficients)*Fbit("0110") // Returns (7 + 0i)|0110>

NumberPotential(const List<real> coefficients, const List<integer> sites) -> RealOperatorFermiParam

Returns an operator representing a weighted sum of number operators isitesαini\sum_{i \in \mathrm{sites}} \alpha_i n_i.

Parameters

  • coefficients: The coefficients αi\alpha_i.
  • sites: The site indices where the operator acts.

Example

var sites = [0,2,3]
var coefficients = [1.0,3.0,4.0]
NumberPotential(coefficients,sites)*Fbit("0110") // Returns (3 + 0i)|0110>