Reorder the qubits in any arbitrary order. NewIndexes is an array of integers that must
equal the length of this register. The qubit at each index in that array will be moved
to the value in the array. Example: the register this is called on contains 3 qubits, indexed
0 - 2. If the array {2, 0, 1} is passed then: the qubit at index 0 will be moved to index 2;
the qubit at index 1 will be moved to index 0; the qubit at index 2 will be moved to index 1.
| C# | Visual Basic | Visual C++ |
public IQuantumRegister SliceReorder( IEnumerable<int> NewIndexes )
Public Function SliceReorder ( _ NewIndexes As IEnumerable(Of Integer) _ ) As IQuantumRegister
public: virtual IQuantumRegister^ SliceReorder( IEnumerable<int>^ NewIndexes ) sealed
- NewIndexes (IEnumerable<(Of <(Int32>)>))
- The array of new
A reference to a register with the reordering performed.
| Exception | Condition |
|---|---|
| SizeMismatchException | Thrown if the length of NewIndexes does
not match the length of this register. |
| ArgumentOutOfRangeException | Thrown if invalid indexes are specified
in NewIndexes |
| DuplicateIndexesException | Thrown if the same index is specified more than once
in NewIndexes. Example: the NewIndexes is {1, 0, 1} this will be thrown because 1 is
specified twice. |
| NotImplementedException | This method is not yet
implemented. |