qleap.Toffoli

class qleap.Toffoli(control1: QState, control2: QState, *args: QState)

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

The Toffoli gate is a three-qubit gate that performs a NOT operation on the target qubit if both control qubits are in the state \(|1\rangle\), and does nothing otherwise.

__init__(control1: QState, control2: QState, *args: QState)

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

Parameters:
  • control1 (QState) – The first control qubit for the Toffoli gate.

  • control2 (QState) – The second control qubit for the Toffoli gate.

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

Raises:

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

Methods

__init__(control1, control2, *args)

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