Diagonal
class qiskit.circuit.library.Diagonal(diag)
Bases: QuantumCircuit
Circuit implementing a diagonal transformation.
Deprecated since version 2.1
The class qiskit.circuit.library.generalized_gates.diagonal.Diagonal
is deprecated as of Qiskit 2.1. It will be removed in Qiskit 3.0. Use DiagonalGate instead.
Parameters
diag (Sequence[complex]) – List of the diagonal entries (for a diagonal gate on qubits).
Raises
CircuitError – if the list of the diagonal entries or the qubit list is in bad format; if the number of diagonal entries is not , where denotes the number of qubits.
Attributes
name
Type: str
A human-readable name for the circuit.
Example
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit