Circuits API Reference¶
QutritCircuit¶
Constructor¶
n_qutrit— number of qutrits (≥ 1)initial_state— column vector of shape(3**n_qutrit, 1), orNonefor \(|0\cdots0\rangle\)
Methods¶
append(gate, first_qutrit, second_qutrit=None, is_dagger=False)
Add a Gate instance to the circuit.
gate— aGateobject fromqutritium.gatesfirst_qutrit— target qutrit index (0-based)second_qutrit— required for two-qutrit gatesis_dagger— ifTrue, appliesgate.inverse()
measure_all()
Add a measurement to all qutrits. Can only be called once per circuit.
reset_circuit()
Remove all operations (measurement flag persists).
draw()
Print a text summary of the circuit.
Properties¶
.n_qutrit— number of qutrits.operation_set— list of operations.measurement_flag— whether measurement has been added
Operators¶
len(qc)— number of operationsqc1 + qc2— concatenate circuits (left must not have measurement)iter(qc)— iterate over operations
Instruction¶
Low-level representation of a gate applied to specific qutrit(s). Normally
created internally by QutritCircuit.append().
Properties¶
.effect_matrix— full-register matrix (\(3^n \times 3^n\)).type— gate name string.gate— reference to theGateobject (if created viaappend())