Quantum Input/Output¶
A common problem in quantum circuits deals with how to get classical data in and out of a quantum computer. Forge provides a method to create a circuit from an array of numerical data which loads that data into a quantum circuit.

qcware.qio.
loader
(data: numpy.ndarray, mode: str = 'optimized', at_beginning_of_circuit: bool = True)¶ Creates a circuit which loads an array of classical data into the state space of a quantum computer or simulator. This is useful in order to act on known data or to simulator quantum RAM.
Arguments:
 Parameters
data (numpy.ndarray) – A 1d array representing the classical data to be represented in the circuit
mode (str) – Whether to used the “optimized” loader (using approximately \(~sqrt(d)\) depth and \(~sqrt(d)\) qubits) or the “parallel” loader (using approximately \(log(d)\) depth and d qubits., defaults to optimized
at_beginning_of_circuit (bool) – Whether the loader is at the beginning of the circuit (in which it performs an initial X gate on the first qubit), defaults to True
 Returns
A Quasar circuit suitable for execution on any quasar backend supporting the required gates which loads the classical vector into a quantum state.
 Return type
quasar.Circuit