0 votes
in Cloud Computing by
What are Classical gates in Quantam Computing?

1 Answer

0 votes
by

Classical gates

1. NOT gate

The NOT gate, also known as the Pauli X gate, flips the  state to , and vice versa. The NOT gate is equivalent to RX for the angle  or to ‘HZH’.

Composer reference

OpenQASM reference

Q-sphere

Note about q-sphere representations

_x_gate

x q[0];

image19

The q-sphere representation shows the state after the gate operates on the initial equal superposition state  where  is the number of qubits needed to support the gate.

2. CNOT gate

The controlled-NOT gate, also known as the controlled-x (CX) gate, acts on a pair of qubits, with one acting as ‘control’ and the other as ‘target’. It performs a NOT on the target whenever the control is in state . If the control qubit is in a superposition, this gate creates entanglement.

All unitary circuits can be decomposed into single qubit gates and CNOT gates. Because the two-qubit CNOT gate costs much more time to execute on real hardware than single qubit gates, circuit cost is sometimes measured in the number of CNOT gates.

Composer reference

OpenQASM reference

Q-sphere

Note about q-sphere representations

cxgate

cx q[0], q[1];

cx_qsph

The q-sphere representation shows the state after the gate operates on the initial equal superposition state  where  is the number of qubits needed to support the gate.

3. Toffoli gate

The Toffoli gate, also known as the double controlled-NOT gate (CCX), has two control qubits and one target. It applies a NOT to the target only when both controls are in state .

The Toffoli gate with the Hadamard gate is a universal gate set for quantum computing.

Composer reference

OpenQASM reference

Q-sphere

Note about q-sphere representations

ccx-gat

ccx q[0], q[1], q[2];

ccx_qsph

The q-sphere representation shows the state after the gate operates on the initial equal superposition state  where  is the number of qubits needed to support the gate.

SWAP gate

The SWAP gate swaps the states of two qubits.

Composer reference

OpenQASM reference

Q-sphere

Note about q-sphere representations

swapgate

swap q[0], q[1];

swap_qsph

The q-sphere representation shows the state after the gate operates on the initial equal superposition state  where  is the number of qubits needed to support the gate.

Identity gate

The identity gate (sometimes called the Id or the I gate) is actually the absence of a gate. It ensures that nothing is applied to a qubit for one unit of gate time.

Composer reference

Qasm reference

idgate

id q[0];

...