1
$\begingroup$

In general, the control bits of a multi-control bit quantum gate are in an AND relationship. Is there a quantum gate that makes the control bits an OR relationship?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

If you can implement standard AND-controlled $U^\dagger$ gate you can implement your OR-controlled $U$ gate without any additional controls, as follows

enter image description here

This is an example for the $S$ gate and 2 control qubits, but it applies universally. A qiskit code snippet for checking.

from qiskit import QuantumCircuit
from qiskit.circuit.library import SGate
from qiskit.quantum_info import Operator
import numpy as np

qc = QuantumCircuit(3)
qc.x(0)
qc.x(1)
qc.s(2)
qc.append(SGate().control(2).inverse(), [0, 1, 2])
qc.x(0)
qc.x(1)

u_target = np.kron(np.diag([1, 0, 0, 0]), np.identity(2))+np.kron(np.diag([0, 1, 1, 1]), np.array([[1, 0], [0, 1j]]))
u_qs = Operator(qc.reverse_bits()).data

print(np.allclose(u_target, u_qs))
qc.draw(output='mpl')
$\endgroup$
4
  • $\begingroup$ Great, looks like it saves qubits more than the first option. $\endgroup$
    – R-X Zhao
    Jul 17 at 12:35
  • $\begingroup$ @R-XZhao 'saving qubits' might have multiple meanings, such as gate count, gate depth or something else. It's better to say precisely what are you optimizing for. $\endgroup$ Jul 17 at 13:07
  • $\begingroup$ I'm building a PQC where one of the submodules wants to implement multiple control quantum gates, and the control relationship is OR or XOR. I can design it by referring to the QISKIT official guide, but it uses a large number of auxiliary qubits, which is a challenge in the nearly 29 qubits system. $\endgroup$
    – R-X Zhao
    Jul 17 at 13:12
  • $\begingroup$ So my idea is to use as few auxiliary qubits as possible without changing the number of qubits, otherwise it will become difficult to achieve. $\endgroup$
    – R-X Zhao
    Jul 17 at 13:14
2
$\begingroup$

You can use the fact that: $$a \lor b = \neg(\neg a \land \neg b)$$ For example, in the following circuit the unitary is applied if either $q_0$ or $q_1$ (or both) equals $1$:

enter image description here

$\endgroup$
2
  • $\begingroup$ This seems to be no longer a gate, but a network. I don't know if there is a quantum gate with OR relationship in quantum information. It can be optical or superconducting. At present, the network is very bloated because of the single relationship of control bits. $\endgroup$
    – R-X Zhao
    Jul 16 at 12:15
  • $\begingroup$ May I ask if it is possible to design a quantum circuit in which the control bits are in an XOR relationship, hoping to save qubits as much as possible. $\endgroup$
    – R-X Zhao
    Jul 16 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.