Consider the following situation, we import a 3-bit Toffoli gate as follows:
from qiskit.aqua.circuits.gates.multi_control_toffoli_gate import _cccx
I further define a Quantum Register of size 4 and a circuit containing it:
qr = QuantumRegister(4, 'q') circuit = QuantumCircuit(qr)
I form a small circuit by applying Hadamard on the last qubit followed by
circuit.h(3) circuit.barrier() _cccx(circuit, q) circuit.barrier() circuit.draw(output="mpl")
The output of the following code is as follows:
As we can see that the underlying logic of
_cccx is shown which makes the circuit too big, is there any way to display a higher-level abstraction which would consume less space and simply conceal the underlying gate logic?
Edit: This question is not limited to $n$-bit Toffoli gate but to any circuit which may even be defined by user.