I tried to obtain the gates after fusion in Qiskit-aer statevector simulator. What I can find now is that it provides a backend option saying fusion_verbose (bool): Output gates generated in fusion optimization into metadata [Default: False]. While I set it, I couldn't figure out a way to get the "metadata".

 simulator = aer.StatevectorSimulator(max_parallel_threads=128,fusion_verbose=True)
 result = execute(circuit,simulator).result()
 statevector = result.get_statevector(circuit)
 config = simulator.configuration()

That information is not in the configuration. I am wondering how I can get those gates.

Another related question is that if I set the highest optimization level in the qiskit transpile function, do I get the same circuits as I was running it in the statevector simulator?

Thank you in advance.


1 Answer 1


Metadata is accessed through execution result, not simulator configuration.


Note: fusion optimization is enabled only if your circuit contains at least 14 qubits. To lower this value, use fusion_threshold option.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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