I'm working on a QRNG program where I need to get the memory information properly. But having made changes to the IBM qiskit packages, it seems there is no option to get the memory from the sampler. How do I solve this issue?
I tried giving 'memory=True' inside the backend initialization and sampler run. But that is not available now.
Open to learning other methods but the approach I use to get memory information is via the Qiskit Runtime API. Assuming it's installed and you've got the libraries. Initialize the session first.
Use the
session.get_memory_info()method to retrieve memory information about the quantum circuit.The
memory_infoobject contains the information about memory usage of the quantum circuit, including the total memory usage, the number of qubits, and the number of quantum gates.This will print the memory information to the console.