Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.19k stars 2.35k forks source link

Error that should not happen, happened when running on real-device backends #597

Closed rraymondhp closed 6 years ago

rraymondhp commented 6 years ago

Informations

What is the current behavior?

The circuits run fine with simulators but cannot be run on real-device backends like ibmqx5 or ibmqx4. The error messages are as below:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-10-588c283b8049> in <module>()
      4 shots = 8000
      5 
----> 6 job_exp = execute(circuits, backend=backend, shots=shots, max_credits=300)
      7 
      8 lapse = 0

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/wrapper/_wrapper.py in execute(circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_transpiler, skip_translation)
    206                    config, basis_gates, coupling_map, initial_layout,
    207                    shots, max_credits, seed, qobj_id, hpc,
--> 208                    skip_transpiler)
    209     # XXX When qobj is done this should replace q_job
    210     q_job = QuantumJob(qobj, backend=backend, preformatted=True, resources={

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/wrapper/_wrapper.py in compile(circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_transpiler, skip_translation)
    168                                     config, basis_gates, coupling_map, initial_layout,
    169                                     shots, max_credits, seed, qobj_id, hpc,
--> 170                                     skip_transpiler)
    171 
    172 

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/_compiler.py in compile(circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_transpiler, skip_translation)
    142                 coupling_map=coupling_map,
    143                 initial_layout=initial_layout,
--> 144                 get_layout=True)
    145             # Map the layout to a format that can be json encoded
    146             list_layout = None

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/_compiler.py in compile_circuit(quantum_circuit, basis_gates, coupling_map, initial_layout, get_layout, format, seed)
    233         cx_cancellation(compiled_dag_circuit)
    234         # Simplify single qubit gates
--> 235         compiled_dag_circuit = optimize_1q_gates(compiled_dag_circuit)
    236         logger.info("post-mapping properties: %s",
    237                     compiled_dag_circuit.property_summary())

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in optimize_1q_gates(circuit)
    840                                               right_parameters[0],
    841                                               right_parameters[1],
--> 842                                               right_parameters[2])
    843                 # Why evalf()? This program:
    844                 #   OPENQASM 2.0;

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in compose_u3(theta1, phi1, lambda1, theta2, phi2, lambda2)
    727     # Careful with the factor of two in yzy_to_zyz
    728     thetap, phip, lambdap = yzy_to_zyz((lambda1 + phi2) / 2,
--> 729                                        theta1 / 2, theta2 / 2)
    730     (theta, phi, lamb) = (2 * thetap, phi1 + 2 * phip, lambda2 + 2 * lambdap)
    731     return (theta.simplify(), phi.simplify(), lamb.simplify())

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in yzy_to_zyz(xi, theta1, theta2, eps)
    711     logger.debug("solutions=%s", pprint.pformat(solutions))
    712     logger.debug("deltas=%s", pprint.pformat(deltas))
--> 713     assert False, "Error! No solution found. This should not happen."
    714 
    715 

AssertionError: Error! No solution found. This should not happen.

Steps to reproduce the problem

The notebook that reproduces the error is here: https://github.com/rraymondhp/qrac/blob/master/32QRAC.ipynb

What is the expected behavior?

Run on real devices as expected from simulators.

Suggested solutions

I don't know.

jaygambetta commented 6 years ago

linking to #607 and closing