split
Method of Qbit.
Overloads
| Name | Description |
|---|---|
split(const integer length_a, const integer length_b) -> List | Splits the Qbit into two parts, returning a list containing the resulting left and right qubit. |
split(const List<integer> left_sites, const List<integer> right_sites) -> List | Splits the product state into a pair of Qbit objects according to specified set of sites for the resulting left and right product state. |
split(const integer length_a, const integer length_b) -> List
Splits the Qbit into two parts, returning a list containing the resulting left and right qubit.
By convention, the coefficient is stored the leftmost qubit product state after the split.
Parameters
- length_a: Length (number of spins) for the first part.
- length_b: Length (number of spins) for the second part.
Returns
A list containing the left and right qubit of size length_a and length_b.
Example
Qbit("110010",5.0).split(4,2) // Returns [(5 + 0i)|1100>, (1 + 0i)|10>]
split(const List<integer> left_sites, const List<integer> right_sites) -> List
Splits the product state into a pair of Qbit objects according to specified set of sites for the resulting left and right product state.
By convention, the coefficient is stored in the leftmost qubit product state after the split.
Parameters
- left_sites: The sites of the Qbit oject that will be used to construct the left product state.
- right_sites: The sites of the Qbit oject that will be used to construct the right product state.
Example
Qbit("001101", 2.0 + 1.0i).split([0,2,3],[1,4,5]) // Returns [(2 + 1i)|011>, (1 + 0i)|001>]