This copies over all the necessary members of the existing register into a new
one so that slice operations only have to worry about manipulating the exposed
qubits. Also makes the expansion of the QuantumRegister class easier since any
copying for slicing can be put here.
| C# | Visual Basic | Visual C++ |
protected virtual QuantumRegister CloneForSlice()
Protected Overridable Function CloneForSlice As QuantumRegister
protected: virtual QuantumRegister^ CloneForSlice()
The cloned register, except for the list of exposed qubits, which will
be manipulated by the caller.
The state of the qubit is an object reference, so changes to the
returned qubit's state still effect the state of this qubit. Thus no-cloning is not
violated.