qleap.Cnot

class qleap.Cnot(control: QState, *args: QState)

Cnot is a class that represents the CNOT gate operation in the QLeap framework.

The CNOT gate is a two-qubit gate that performs a NOT operation on the target qubit(s) if the control qubit is in the state \(|1\rangle\), and does nothing if the control qubit is in the state \(|0\rangle\).

__init__(control: QState, *args: QState)

Creates a Cnot instance that represents a CNOT gate operation with the given control qubit and target qubits.

Parameters:
  • control (QState) – The control qubit for the CNOT gate.

  • *args (QState) – The target qubit(s) for the CNOT gate.

Raises:

ValueError – If the control argument contains more than one qubit.

Methods

__init__(control, *args)

Creates a Cnot instance that represents a CNOT gate operation with the given control qubit and target qubits.