Hi @sassan_moradi!
This can be done by following the example below:
import pennylane as qml
dev = qml.device("qiskit.aer", wires=1)
@qml.qnode(dev)
def f(x):
qml.RX(x, wires=0)
return qml.expval(qml.PauliZ(0))
f(0.3)
dev._circuit.qasm(formatted=True)
For this, you will need the PennyLane-Qiskit plugin. The code above works by simply converting to a Qiskit circuit and then using the Qiskit circuit’s qasm() method. This isn’t really a central feature of PennyLane, so please let us know if you encounter any troubles!
Thanks!