Skip to main content

Fbit

An object representing a product state of fermionic modes.

This class represents a product state of fermionic modes together with its associated multiplicative coefficient. Each fermionic mode (0\vert 0 \rangle or 1\vert 1 \rangle) corresponds respectively to an unoccupied and occupied site. In other words, given the fermionic number operator n=ccn = c^{\dagger} c, one has that (I2n)0=0,(I2n)1=1.(\mathbb{I} - 2n) \vert 0 \rangle = \vert 0 \rangle, \quad (\mathbb{I} - 2n)\vert 1 \rangle = \vert 1 \rangle. The number of fermionic modes in the product state corresponds to the number of sites on which it has support.

Factories

Fbit(const string bitstring) -> Fbit

Constructs a fermionic product state from a string of consecutive characters "00" and "11".

Parameters

  • bitstring: A string representing the states of the fermionic modes in the product state.

Example

Fbit("00110") // Returns (1 + 0i)|00110>

Fbit(integer num_sites) -> Fbit

Constructs a fermionic product state of size num_sites with every fermionic mode set to 00.

Parameters

  • num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.

Example

Fbit(4) // Returns (1 + 0i)|0000>

Fbit(const string bitstring, complex coefficient) -> Fbit

Constructs a fermionic product state from a string of "00" and "11" with a specified complex multiplicative coefficient.

Parameters

  • bitstring: A string representing the states of the fermionic modes in the product state.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit("00110", 2.0 + 5.0i) // Returns (2 + 5i)|00110>

Fbit(const string bitstring, bool coefficient) -> Fbit

Constructs a fermionic product state from a string of "00" and "11" with a specified bool (converted to complex) multiplicative coefficient.

Parameters

  • bitstring: A string representing the states of the fermionic modes in the product state.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit("00110", true) // Returns (1 + 0i)|00110>

Fbit(const string bitstring, real coefficient) -> Fbit

Constructs a fermionic product state from a string of "00" and "11" with a specified real (converted to complex) multiplicative coefficient.

Parameters

  • bitstring: A string representing the states of the fermionic modes in the product state.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit("00110", 2.0) // Returns (2 + 0i)|00110>

Fbit(const string bitstring, integer coefficient) -> Fbit

Constructs a fermionic product state from a string of "00" and "11" with a specified integer (converted to complex) multiplicative coefficient.

Parameters

  • bitstring: A string representing the states of the fermionic modes in the product state.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit("00110", 3) // Returns (3 + 0i)|00110>

Fbit(integer num_sites, complex coefficient) -> Fbit

Constructs a fermionic product state of size num_sites with every fermionic mode set to 00 with a specified complex multiplicative coefficient.

Parameters

  • num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit(4, 2.0 + 5.0i) // Returns (2 + 5i)|0000>

Fbit(integer num_sites, bool coefficient) -> Fbit

Constructs a fermionic product state of size num_sites with every fermionic mode set to 00 with a specified bool (converted to complex) multiplicative coefficient.

Parameters

  • num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit(4, true) // Returns (1 + 0i)|0000>

Fbit(integer num_sites, real coefficient) -> Fbit

Constructs a fermionic product state of size num_sites with every fermionic mode set to 00 with a specified real (converted to complex) multiplicative coefficient.

Parameters

  • num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit(4, 2.0) // Returns (2 + 0i)|0000>

Fbit(integer num_sites, integer coefficient) -> Fbit

Constructs a fermionic product state of size num_sites with every fermionic mode set to 00 with a specified integer (converted to complex) multiplicative coefficient.

Parameters

  • num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
  • coefficient: The coefficient that multiplies the fermion product state.

Example

Fbit(4, 3) // Returns (3 + 0i)|0000>

Symbols

NameDescription
=Assignment operator for Fbit objects.
[]Returns the state of the fermionic mode (interpreted as an integer) at the specified site.

Members

NameDescription
countReturns the sum of the occupation numbers of a subset of sites (interpreted as integers) in the product state.
createApplies the creation operator cic_i^{\dagger} on the fermionic product state in place.
createdReturns a copy of the product state on which the creation operator cic_i^{\dagger} was applied.
destroyApplies the annihilation operator cic_i on the fermionic product state in place.
destroyedReturns a copy of the product state on which the annihilation operator cic_i was applied.
flipThis method modifies the Fbit object in place by flipping the state of the fermionic modes at the specified sites.
flippedReturns a copy of the product state with the fermionic mode at the specified site flipped.
get_stateReturns the state of the fermionic mode (interpreted as an integer) at the specified site.
insertInserts a fermionic mode set to 0 at the specified site.
insertedReturns a copy of the product state with a fermionic mode in the "00" state inserted on the left of the fermionic mode at the specified site.
periodReturns the number of times the fermionic modes have to be circularly shifted to the right by a number of sites equal to the provided integer before the obtained product state is equal to the starting product state.
reflectReverses the product state (reversed end-to-end) in place.
reflectedReturns a copy of the reflected (reversed end-to-end) product state.
set_representationSets the integer representation of the Fbit.
splitSplits the product state into a pair of Fbit objects according to a specified set of states for the resulting left and right product state.
swapThis methods swaps the fermionic modes of the product state at the specified sites in place.
swappedReturns a copy of the Fbit object with two specified fermionic modes swapped.
translateCircularly shifts in place the fermionic modes of the product state by 11 site to the right.
translatedReturns a copy of the product state with its fermionic modes shifted by 11 site to the right.