qrisp.QuantumCircuit.to_gate#

QuantumCircuit.to_gate(name=None)[source]#

Similar to to_op but raises an exception if self contains classical bits (like the Qiskit equivalent). # noqa

Parameters:
namestr, optional

A name for the resulting gate. The default is None.

Returns:
Operation

The QuantumCircuit turned into an Operation instance.

Raises:
Exception

Tried to turn a circuit including classical bits into unitary gate