pub fn alloc_qubit(&mut self, piece: Option<crate::Piece>, name: String, purpose: String) -> usize {
        let state = replace(&mut self.state, Box::new(PlaceHolderSimulator));
        let (state, qbit) = state.alloc_qubit();
        self.state = state;
        self.record_alloc_qbit(qbit, piece, name, purpose);
        qbit
    }
/// Get a new qubit. If no qubit's have been freed and we have
/// not yet hit our maximum, this returns qubit n where n qubits
/// have been previously allocated (useful if you want non
/// ancilla qubits at fixed positions). After qubits have been
/// freed all bets are off.
Get a new qubit. If no qubit's have been freed and we have
not yet hit our maximum, this returns qubit n where n qubits
have been previously allocated (useful if you want non
ancilla qubits at fixed positions). After qubits have been
freed all bets are off.
Get a new qubit . If no qubit ' s have been freed and we have not yet hit our maximum this returns qubit n where n qubits have been previously allocated ( useful if you want non ancilla qubits at fixed positions ) . After qubits have been freed all bets are off .
pub fn alloc_qubit(&mut self, piece: Option<crate::Piece>, name: String, purpose: String) -> usize {
        let state = replace(&mut self.state, Box::new(PlaceHolderSimulator));
        let (state, qbit) = state.alloc_qubit();
        self.state = state;
        self.record_alloc_qbit(qbit, piece, name, purpose);
        qbit
    }
pub fn alloc_qubit ( & mut self , piece : Option < crate :: Piece > , name : String , purpose : String ) -> usize { let state = replace ( & mut self . state , Box :: new ( PlaceHolderSimulator ) ) ; let ( state , qbit ) = state . alloc_qubit ( ) ; self . state = state ; self . record_alloc_qbit ( qbit , piece , name , purpose ) ; qbit }
Get a new qubit.
Get a new qubit .
&mut self
piece
Option<crate::Piece>
name
String
purpose
String
&mut self
piece
Option<crate::Piece>
name
String
purpose
String