set_representation
Method of Fbit.
set_representation(integer value) -> Fbit
Sets the integer representation of the Fbit.
This method makes use of the binary expansion of an integer to set the value of the fermionic modes that appear in the product state. For example, the integer 0B1100 leads to the product state |0011>. Note that the bit values appear in reverse order in the Fbit object. The number of significant bits of the integer must not exceed the number of sites on which the Fbit object has support. For example Fbit(2).set_representation(0B1100) yields an error because the Fbit object has size 2, but 0B1100 requires 4 bits.
Parameters
- value: The integer whose binary expansion is used to set the states of the fermionic modes in the product state.
Example
Fbit(4).set_representation(0B1100) // Returns (1 + 0i)|0011>
// Fbit(2).set_representation(0B1100) //Error "The integer 0B1100 requires 4 bits, which exceeds the number of sites 2 of the Fbit object."