Set the specified qubits to the value specified.
Declaration Syntax
C# | Visual Basic | Visual C++ |
IQuantumRegister SetQubits( int[] Indexes, bool SetTo )
Function SetQubits ( _ Indexes As Integer(), _ SetTo As Boolean _ ) As IQuantumRegister
IQuantumRegister^ SetQubits( array<int>^ Indexes, bool SetTo )
Parameters
- Indexes (array< Int32 >[]()[])
- The indexes of the qubits to set.
- SetTo (Boolean)
- Value to set the qubits to, true (1) or false (0).
Return Value
A reference to the modified register.
Remarks
A qubit is measured before it is set, so any other qubits entangled
with these will be effected.
Exceptions
Exception | Condition |
---|---|
IndexOutOfRangeException | Thrown if any of the specified
indexes are out of range. |