1

Upon trying to draw a ZZFeatureMap instance, I only see the name "ZZFeatureMap" and not its architecture. Please find the code snippet and output attached:

from qiskit.circuit.library import ZZFeatureMap
zz = ZZFeatureMap(2, entanglement="full", reps=2)
zz.draw("mpl")

enter image description here

However, print(zz) prints the architecture of the circuit but it is not drawn with matplotlib.

enter image description here

Please help me draw the internals of the architecture of circuit with the draw() function. Thank you!

danronmoon
  • 3,814
  • 5
  • 34
  • 56

1 Answers1

2

Use the decompose method of a QuantumCircuit object:

from qiskit.circuit.library import ZZFeatureMap
zz = ZZFeatureMap(2, entanglement="full", reps=2)
zz.decompose().draw("mpl")

Circuit with decomposition

Tristan Nemoz
  • 1,844
  • 1
  • 6
  • 19