1

I know that working with Aer.get_backend("statevector_simulator") gives me a statevector. I am trying to get the statevector when I worked with the IBM's quantum computers. To explain in the codes;

From the code below I can reach the statevector.

backend = Aer.get_backend('statevector_simulator')
job = execute(circ, backend)
print(f"print(job):{job}\n\n")
#print(job.status())
result = job.result()
print(f"print(result):{result}\n\n")
output = result.get_statevector(circ, decimals=5)
print(f"print(output):{output}\n\n")

,and my question is wheter I can get the statevector while using one of the IBM's computer;

provider = IBMQ.load_account()
provider = IBMQ.get_provider("ibm-q")
device = least_busy(provider.backends(filters=lambda x: x.configuration().n_qubits >= 3 and 
                                   not x.configuration().simulator and x.status().operational==True))

job = execute(circ, device)

result = job.result()

output = result.get_statevector(circ, decimals=5)

The last line is where I get the error. I need to figure out how to get the statevector from job.result()

1 Answers1

2

Real devices by definition will never be able to return the statevector. Because measurement collapses the state. You can perform state tomography to restore the quantum state (obviously it's an exponential procedure).