Qbit
Overloads
| Name | Description |
|---|---|
Qbit(integer num_sites) -> Qbit | Constructs a qubit product state of size num_sites with every qubit set to . |
Qbit(const string bitstring) -> Qbit | Constructs a qubit product state from a string of consecutive characters "" and "". |
Qbit(integer num_sites, complex coefficient) -> Qbit | Constructs a qubit product state of the specified size with every qubit set to with a specified complex multiplicative coefficient. |
Qbit(integer num_sites, bool coefficient) -> Qbit | Constructs a qubit product state of the specified size with every qubit set to with a specified bool (converted to complex) multiplicative coefficient. |
Qbit(const string bitstring, real coefficient) -> Qbit | Constructs a qubit product state from a string of "" and "" with a specified real (converted to complex) multiplicative coefficient. |
Qbit(const string bitstring, bool coefficient) -> Qbit | Constructs a qubit product state from a string of "" and "" with a specified bool (converted to complex) multiplicative coefficient. |
Qbit(const string bitstring, complex coefficient) -> Qbit | Constructs a qubit product state from a string of "" and "" with a specified complex multiplicative coefficient. |
Qbit(integer num_sites, real coefficient) -> Qbit | Constructs a qubit product state of the specified size with every qubit set to with a specified real (converted to complex) multiplicative coefficient. |
Qbit(const string bitstring, integer coefficient) -> Qbit | Constructs a qubit product state from a string of "" and "" with a specified integer (converted to complex) multiplicative coefficient. |
Qbit(integer num_sites, integer coefficient) -> Qbit | Constructs a qubit product state of the specified size with every qubit set to with a specified integer (converted to complex) multiplicative coefficient. |
Qbit(integer num_sites) -> Qbit
Constructs a qubit product state of size num_sites with every qubit set to .
Parameters
- num_sites: The number of qubits in the product state in a one to one correspondence with the sites.
Example
Qbit(4) // Returns (1 + 0i)|0000>
Qbit(const string bitstring) -> Qbit
Constructs a qubit product state from a string of consecutive characters "" and "".
Parameters
- bitstring: A string representing the states of the qubits in the product state.
Example
Qbit("00110") // Returns (1 + 0i)|00110>
Qbit(integer num_sites, complex coefficient) -> Qbit
Constructs a qubit product state of the specified size with every qubit set to with a specified complex multiplicative coefficient.
Parameters
- num_sites: The number of qubits in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit(4, 2.0 + 5.0i) // Returns (2 + 5i)|0000>
Qbit(integer num_sites, bool coefficient) -> Qbit
Constructs a qubit product state of the specified size with every qubit set to with a specified bool (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of qubits in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit(4, true) // Returns (1 + 0i)|0000>
Qbit(const string bitstring, real coefficient) -> Qbit
Constructs a qubit product state from a string of "" and "" with a specified real (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the qubits in the product state.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit("00110", 2.0) // Returns (2 + 0i)|00110>
Qbit(const string bitstring, bool coefficient) -> Qbit
Constructs a qubit product state from a string of "" and "" with a specified bool (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the qubits in the product state.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit("00110", true) // Returns (1 + 0i)|00110>
Qbit(const string bitstring, complex coefficient) -> Qbit
Constructs a qubit product state from a string of "" and "" with a specified complex multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the qubits in the product state.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit("00110", 2.0 + 5.0i) // Returns (2 + 5i)|00110>
Qbit(integer num_sites, real coefficient) -> Qbit
Constructs a qubit product state of the specified size with every qubit set to with a specified real (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of qubits in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit(4, 2.0) // Returns (2 + 0i)|0000>
Qbit(const string bitstring, integer coefficient) -> Qbit
Constructs a qubit product state from a string of "" and "" with a specified integer (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the qubits in the product state.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit("00110", 3) // Returns (3 + 0i)|00110>
Qbit(integer num_sites, integer coefficient) -> Qbit
Constructs a qubit product state of the specified size with every qubit set to with a specified integer (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of qubits in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the qubit product state.
Example
Qbit(4, 3) // Returns (3 + 0i)|0000>