# How exactly does the QuantumCircuit.decompose() method work?

From what I can understand from the source code, the circuit is converted into a DAG before the decomposition transpiler is performed onto the DAG circuit.

How does converting to a DAG circuit help us recognise the gate operations needed to reach a certain state say for example the entangled state $$\frac{1}{\sqrt{2}}(|00\rangle +|11\rangle)$$. Or basically, how does that decomposition work?

• This answer may help giving you an idea Jun 28 '21 at 18:11