Returns a slice (subset) of the quantum register.
Declaration Syntax
C# | Visual Basic | Visual C++ |
IQuantumRegister Slice( int StartIndex, int StopIndex )
Function Slice ( _ StartIndex As Integer, _ StopIndex As Integer _ ) As IQuantumRegister
IQuantumRegister^ Slice( int StartIndex, int StopIndex )
Parameters
- StartIndex (Int32)
- Starting index in the register to get the slice of.
- StopIndex (Int32)
- Ending index in the register to get the slice of.
Return Value
A quantum register representing the slice.
Exceptions
Exception | Condition |
---|---|
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. |