unitaria.Circuit¶
- class unitaria.Circuit(tq_circuit: QCircuit | None = None)[source]¶
Bases:
objectRepresentation of a quantum circuit.
This is just a wrapper around the Tequila
QCircuitclass.- Parameters:
tq_circuit – The representation of the circuit for the tequila backend.
- draw() str[source]¶
Draw this circuit and return a string representation.
If qpic is installed, this will generate a temporary file containing a pdf of the circuit and return a
file://url to the pdf, which should be printed to the user.
- simulate(input: ndarray | int = 0, **kwargs) ndarray[source]¶
Simulate this circuit. For additional arguments see
simulate().- Parameters:
input – The initial state from which the circuit should be simulated. If
inputis a vector, it will be interpreted as amplitudes of the computational basis states and its dimension should be2 ** n_qubits. If it is an integeri, it will be interpreted as thei-th computational basis state.