[−][src]Function dqcsim::bindings::dqcs_gate_new_prep
#[no_mangle]pub extern "C" fn dqcs_gate_new_prep(
targets: dqcs_handle_t,
matrix: dqcs_handle_t
) -> dqcs_handle_t
Constructs a new prep gate.
targets
must be a handle to a qubit set. matrix
is an optional matrix
handle signifying the state that the qubits are initialized to. If zero,
the qubits are initialized to |0>. Otherwise, it must be a handle to a
unitary 2x2 matrix, and the semantics are as follows:
- initialize each qubit to |0>
- apply the matrix to each qubit
This function returns the handle to the gate, or 0 to indicate failure.
The targets
qubit set and matrix
handle are consumed/deleted by this
function if and only if it succeeds.