Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile Grover's circuit on ibmqx5 #520

Closed
rraymondhp opened this issue May 29, 2018 · 9 comments

Comments

Projects
None yet
3 participants
@rraymondhp
Copy link
Member

commented May 29, 2018

qiskit failed to compile a circuit for Grover algorithms as described in this tutorial:

https://github.com/rraymondhp/qiskit-tutorial/blob/37b3229c8988bbaf1edda744de456cf195e25fc7/reference/algorithms/grover_algorithm.ipynb

Expected Behavior

qiskit v0.4.15 could compile the same program on ibmqx5 coupling map.

Current Behavior

AssertionError that should not happen, happened.

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-9-93ef2321f491> in <module>()
     30 backend_coupling = backend_config['coupling_map']
     31 
---> 32 compiled_circuit = qp.compile([circuitName], backend=backend, coupling_map=backend_coupling)
     33 compiled_qasm = qp.get_compiled_qasm(compiled_circuit, circuitName)
     34 print("Number of gates at ", circuitName, " circuit is ", len(compiled_qasm.split("\n")) - 4)

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/_quantumprogram.py in compile(self, name_of_circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_translation)
    972                                       config, basis_gates, coupling_map, initial_layout,
    973                                       shots, max_credits, seed, qobj_id, hpc,
--> 974                                       skip_translation)
    975         return qobj
    976 

~/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_translation)
    171                                     config, basis_gates, coupling_map, initial_layout,
    172                                     shots, max_credits, seed, qobj_id, hpc,
--> 173                                     skip_translation)
    174 
    175 

~/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_translation)
    146                 coupling_map=coupling_map,
    147                 initial_layout=initial_layout,
--> 148                 get_layout=True)
    149             # Map the layout to a format that can be json encoded
    150             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)
    237         cx_cancellation(compiled_dag_circuit)
    238         # Simplify single qubit gates
--> 239         compiled_dag_circuit = optimize_1q_gates(compiled_dag_circuit)
    240         logger.info("post-mapping properties: %s",
    241                     compiled_dag_circuit.property_summary())

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in optimize_1q_gates(circuit)
    849                                               right_parameters[0],
    850                                               right_parameters[1],
--> 851                                               right_parameters[2])
    852                 # Why evalf()? This program:
    853                 #   OPENQASM 2.0;

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in compose_u3(theta1, phi1, lambda1, theta2, phi2, lambda2)
    736     # Careful with the factor of two in yzy_to_zyz
    737     thetap, phip, lambdap = yzy_to_zyz((lambda1 + phi2) / 2,
--> 738                                        theta1 / 2, theta2 / 2)
    739     (theta, phi, lamb) = (2 * thetap, phi1 + 2 * phip, lambda2 + 2 * lambdap)
    740     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)
    720     logger.debug("solutions=%s", pprint.pformat(solutions))
    721     logger.debug("deltas=%s", pprint.pformat(deltas))
--> 722     assert False, "Error! No solution found. This should not happen."
    723 
    724 

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

Possible Solution

Steps to Reproduce (for bugs)

  1. Run this tutorial: https://github.com/rraymondhp/qiskit-tutorial/blob/37b3229c8988bbaf1edda744de456cf195e25fc7/reference/algorithms/grover_algorithm.ipynb

Context

Your Environment

  • Version used: qiskit-sdk-py version 0.5.3
  • Environment name and version (e.g. Python 3.6.1): Python 3.6.x
  • Operating System and version: MacOSX
@nonhermitian

This comment has been minimized.

Copy link
Contributor

commented May 30, 2018

I was able to run the notebook without issue.

@rraymondhp

This comment has been minimized.

Copy link
Member Author

commented May 30, 2018

Thanks for confirming this. I ran it three times: two failed and one succeeded. I suspect it is related to the pseudo-random number used in the compile?

@rraymondhp

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

One of the latest runs:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-7-93ef2321f491> in <module>()
     30 backend_coupling = backend_config['coupling_map']
     31 
---> 32 compiled_circuit = qp.compile([circuitName], backend=backend, coupling_map=backend_coupling)
     33 compiled_qasm = qp.get_compiled_qasm(compiled_circuit, circuitName)
     34 print("Number of gates at ", circuitName, " circuit is ", len(compiled_qasm.split("\n")) - 4)

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/_quantumprogram.py in compile(self, name_of_circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_translation)
    972                                       config, basis_gates, coupling_map, initial_layout,
    973                                       shots, max_credits, seed, qobj_id, hpc,
--> 974                                       skip_translation)
    975         return qobj
    976 

~/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_translation)
    171                                     config, basis_gates, coupling_map, initial_layout,
    172                                     shots, max_credits, seed, qobj_id, hpc,
--> 173                                     skip_translation)
    174 
    175 

~/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_translation)
    146                 coupling_map=coupling_map,
    147                 initial_layout=initial_layout,
--> 148                 get_layout=True)
    149             # Map the layout to a format that can be json encoded
    150             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)
    237         cx_cancellation(compiled_dag_circuit)
    238         # Simplify single qubit gates
--> 239         compiled_dag_circuit = optimize_1q_gates(compiled_dag_circuit)
    240         logger.info("post-mapping properties: %s",
    241                     compiled_dag_circuit.property_summary())

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in optimize_1q_gates(circuit)
    849                                               right_parameters[0],
    850                                               right_parameters[1],
--> 851                                               right_parameters[2])
    852                 # Why evalf()? This program:
    853                 #   OPENQASM 2.0;

~/miniconda3/envs/QISKitenv/lib/python3.6/site-packages/qiskit/mapper/_mapping.py in compose_u3(theta1, phi1, lambda1, theta2, phi2, lambda2)
    736     # Careful with the factor of two in yzy_to_zyz
    737     thetap, phip, lambdap = yzy_to_zyz((lambda1 + phi2) / 2,
--> 738                                        theta1 / 2, theta2 / 2)
    739     (theta, phi, lamb) = (2 * thetap, phi1 + 2 * phip, lambda2 + 2 * lambdap)
    740     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)
    720     logger.debug("solutions=%s", pprint.pformat(solutions))
    721     logger.debug("deltas=%s", pprint.pformat(deltas))
--> 722     assert False, "Error! No solution found. This should not happen."
    723 
    724 

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

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

This is part of the output when it succeeded:

Available backends ['local_qasm_simulator', 'local_unitary_simulator', 'local_clifford_simulator', 'ibmqx4', 'ibmqx2', 'local_statevector_simulator', 'ibmqx5', 'ibmq_qasm_simulator']
Number of gates at  grover  circuit is  2199
#-------- QASM FILE -------#
OPENQASM 2.0;
include "qelib1.inc";
qreg q[16];
creg ans[3];
u2(0,3.14159265358979) q[15];
u2(0,3.14159265358979) q[4];
u3(1.57079632679490,3.14159265358979,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[15],q[14];
cx q[1],q[2];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u3(1.57079632679490,3.14159265358979,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[1];
u2(0,3.14159265358979) q[2];
cx q[15],q[2];
cx q[15],q[14];
u2(0,3.14159265358979) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[3],q[4];
u1(-0.785398163397448) q[4];
cx q[1],q[2];
cx q[3],q[4];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[1];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
cx q[2],q[3];
u2(0,3.92699081698724) q[3];
u2(0,3.14159265358979) q[4];
cx q[3],q[4];
u2(0.785398163397448,3.14159265358979) q[4];
u2(-0.785398163397448,3.14159265358979) q[3];
cx q[2],q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.92699081698724) q[4];
cx q[2],q[3];
u1(-0.785398163397448) q[3];
u1(0.785398163397448) q[2];
cx q[2],q[3];
cx q[13],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[14];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
cx q[13],q[14];
u1(-0.785398163397448) q[14];
cx q[15],q[14];
u1(0.785398163397448) q[14];
cx q[13],q[14];
u1(-0.785398163397448) q[14];
u1(0.785398163397448) q[13];
cx q[15],q[14];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
cx q[15],q[14];
u2(0,3.92699081698724) q[13];
u1(0.785398163397448) q[15];
u1(-0.785398163397448) q[14];
cx q[15],q[14];
u1(6.28318530717959) q[15];
u2(0,3.14159265358979) q[14];
cx q[3],q[14];
u1(-0.785398163397448) q[14];
cx q[13],q[4];
cx q[15],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
cx q[15],q[14];
u1(0.785398163397448) q[14];
cx q[3],q[14];
u1(-0.785398163397448) q[14];
u1(0.785398163397448) q[3];
cx q[15],q[14];
cx q[3],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[3];
cx q[3],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[3];
cx q[3],q[14];
cx q[15],q[14];
u2(0,10.2101761241668) q[3];
u1(0.785398163397448) q[15];
u1(-0.785398163397448) q[14];
cx q[15],q[14];
u3(3.14159265358979,0,3.14159265358979) q[15];
u3(3.14159265358979,0,3.14159265358979) q[14];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
cx q[15],q[14];
u2(0,3.14159265358979) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
cx q[15],q[2];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
cx q[15],q[0];
u2(0,3.14159265358979) q[14];
cx q[3],q[14];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(-0.785398163397448,3.14159265358979) q[3];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[15],q[2];
u1(0.785398163397448) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
cx q[3],q[14];
u2(0.785398163397448,3.14159265358979) q[14];
u2(-0.785398163397448,3.14159265358979) q[3];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[15],q[2];
cx q[15],q[14];
u2(0,3.92699081698724) q[2];
u1(0.785398163397448) q[15];
u1(-0.785398163397448) q[14];
cx q[15],q[14];
cx q[2],q[3];
u1(-0.785398163397448) q[3];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
cx q[2],q[3];
u1(0.785398163397448) q[3];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[1],q[2];
u2(0,2.35619449019234) q[2];
u2(0,3.92699081698724) q[1];
u2(0,3.14159265358979) q[3];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.92699081698724) q[3];
cx q[3],q[14];
u2(0,3.14159265358979) q[2];
cx q[1],q[2];
u3(-0.785398163397448,1.57079632679490,4.71238898038469) q[2];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[1];
cx q[1],q[2];
u3(-1.57079632679490,3.14159265358979,3.14159265358979) q[2];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[3];
cx q[3],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[3];
cx q[3],q[14];
u2(0,3.14159265358979) q[3];
cx q[2],q[3];
u2(-0.785398163397448,3.14159265358979) q[2];
cx q[15],q[2];
u2(0,3.92699081698724) q[2];
cx q[2],q[3];
u3(-0.785398163397448,1.57079632679490,4.71238898038469) q[3];
u2(-0.785398163397448,3.14159265358979) q[2];
cx q[15],q[2];
u1(7.06858347057703) q[2];
cx q[1],q[2];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
cx q[3],q[14];
u3(-0.785398163397448,1.57079632679490,4.71238898038469) q[14];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[3];
cx q[3],q[14];
u3(2.44929359829471e-16,1.57079632679490,-1.57079632679490) q[14];
u3(-1.57079632679490,3.14159265358979,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[1];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[13];
cx q[13],q[4];
cx q[3],q[4];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[2];
cx q[1],q[2];
u2(-0.785398163397448,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
cx q[15],q[0];
u1(0.785398163397448) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
cx q[15],q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0.785398163397448,3.14159265358979) q[2];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[1];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.92699081698724) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u3(-0.785398163397448,1.57079632679490,4.71238898038469) q[0];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[1];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[3],q[4];
u1(-0.785398163397448) q[4];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
cx q[2],q[3];
u2(0,3.92699081698724) q[3];
u2(0,3.14159265358979) q[4];
cx q[3],q[4];
u2(0.785398163397448,3.14159265358979) q[4];
u2(-0.785398163397448,3.14159265358979) q[3];
cx q[2],q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.92699081698724) q[4];
cx q[2],q[3];
u1(-0.785398163397448) q[3];
u1(0.785398163397448) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u3(3.14159265358979,0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
cx q[1],q[2];
u1(-0.785398163397448) q[2];
cx q[15],q[2];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[4];
u2(0,3.14159265358979) q[3];
cx q[3],q[4];
u2(0,3.14159265358979) q[3];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
cx q[1],q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u3(-0.785398163397448,1.57079632679490,4.71238898038469) q[15];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[1];
cx q[1],q[2];
u2(0,3.14159265358979) q[2];
cx q[15],q[2];
u2(0.785398163397448,3.14159265358979) q[2];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[1];
cx q[1],q[0];
cx q[1],q[2];
u1(-0.785398163397448) q[2];
u1(0.785398163397448) q[1];
cx q[1],q[2];
u3(1.57079632679490,3.14159265358979,3.14159265358979) q[1];
u3(-0.785398163397448,1.57079632679490,-1.57079632679490) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u3(0.785398163397448,1.57079632679490,4.71238898038469) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0.785398163397448,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
cx q[13],q[14];
u1(-0.785398163397448) q[14];
u1(0.785398163397448) q[13];
cx q[15],q[14];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
cx q[15],q[14];
u2(0,3.92699081698724) q[13];
u1(0.785398163397448) q[15];
u1(-0.785398163397448) q[14];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
cx q[13],q[14];
cx q[15],q[14];
u2(0,3.14159265358979) q[13];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[15];
cx q[15],q[14];
cx q[15],q[0];
u1(-0.785398163397448) q[0];
cx q[15],q[0];
u2(0,3.14159265358979) q[14];
cx q[13],q[14];
u2(0,3.14159265358979) q[14];
u2(0,3.14159265358979) q[13];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
cx q[15],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
u2(0,3.14159265358979) q[2];
u2(0,3.14159265358979) q[15];
cx q[15],q[2];
cx q[15],q[0];
u2(0,3.14159265358979) q[2];
cx q[2],q[3];
u2(0.785398163397448,3.14159265358979) q[2];
u2(0,3.14159265358979) q[0];
u2(0,3.14159265358979) q[15];
cx q[15],q[0];
@rraymondhp

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

Repeating the trials for 10 times, 7 failed and 3 succeeded. So, the compile seems to be probabilistic but has high failure rate for this circuit.

@nonhermitian

This comment has been minimized.

Copy link
Contributor

commented May 31, 2018

Indeed, it does seem to fail often. Even when the seed=13, which was the old default value.

@rraymondhp

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

Indeed 13 is an unfortunate number :-)

@rraymondhp

This comment has been minimized.

Copy link
Member Author

commented May 31, 2018

@nonhermitian I fixed seed=0 and compiled successfully.
I have pulled the PR related to this issue to the qiskit-tutorial, but I think I will just leave this issue open here for references until we are sure it is addressed. However, if you want it to be closed that is also fine with me.

@nonhermitian

This comment has been minimized.

Copy link
Contributor

commented May 31, 2018

Fixing the seed is good. However, Inwould still leave the issue open as it still highlights an error in the mapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.