Slice (subset) a quantum register and perform operations on the slice.
| C# | Visual Basic | Visual C++ |
public IQuantumRegister Slice( int StartIndex, int StopIndex, IEnumerable<IQuantumOperation> Operations )
Public Function Slice ( _ StartIndex As Integer, _ StopIndex As Integer, _ Operations As IEnumerable(Of IQuantumOperation) _ ) As IQuantumRegister
public: virtual IQuantumRegister^ Slice( int StartIndex, int StopIndex, IEnumerable<IQuantumOperation^>^ Operations ) sealed
- StartIndex (Int32)
- Starting index in the register to get the slice of.
- StopIndex (Int32)
- Ending index in the register to get the slice of.
- Operations (IEnumerable<(Of <(IQuantumOperation>)>))
- The operation sto apply to the slice.
A quantum register representing the slice with the operations
applied.
| Exception | Condition |
|---|---|
| SizeMismatchException | Thrown if the number of qubits
any of the operations operates on does not match the size of the slice.
|
| IndexOutOfRangeException | Thrown if the start or stop index parameters
are out of range. |
| ArgumentOutOfRangeException | Thrown if the stop index is less
than the start index. |
| NotUnitaryOperationException | Thrown if a non-unitary operation is
passed. All quantum operations must be unitary. |
| SizeMismatchException | Thrown if the size of one of the operations
does not match the size of the register. |
| ArgumentException | Thrown if the operation does not have
AbstractSimulatedQuantumOperation as a base class. |