@@ -0,0 +1,1330 @@
+import cirq%0A%0A# Due to the directory structure of QFlex%0A# go up in hierarchy twice%0Aimport sys%0Asys.path.insert(1, '../../')%0A%0Afrom python.cirq_interface.qflex_circuit import QFlexCircuit%0A%0Adef test_resolve_parameters():%0A    # After a circuit with symbols was resolved%0A    # Does the resulting circuit still have the same device and grid?%0A%0A%0Adef test_translate_cirq_to_qflex():%0A%0A    qubit_1 = cirq.GridQubit(0, 0)%0A    qubit_2 = cirq.GridQubit(0, 1)%0A%0A    circuit = cirq.Circuit()%0A    circuit.append(cirq.Moment(%5Bcirq.ops.H.on(qubit_1)%5D))%0A    circuit.append(cirq.Moment(%5Bcirq.ops.T.on(qubit_1)%5D))%0A    circuit.append(cirq.Moment(%5Bcirq.ops.XPowGate(exponent=0.5).on(qubit_1)%5D))%0A    circuit.append(cirq.Moment(%5Bcirq.ops.YPowGate(exponent=0.5).on(qubit_1)%5D))%0A    circuit.append(cirq.Moment(%5Bcirq.ops.CNOT.on(qubit_1, qubit_2)%5D))%0A    circuit.append(cirq.Moment(%5Bcirq.ops.CZ.on(qubit_1, qubit_2)%5D))%0A%0A    file_lines = %5B%0A        %222%22,%0A        %220 h 1%22,%0A        %221 t 1%22,%0A        %222 x_1_2 1%22,%0A        %223 y_1_2 1%22,%0A        %224 cx 1 2%22,%0A        %225 cz 1 2%22%0A    %5D%0A%0A    qubits_to_index_dict = %7B qubit_1: 1, qubit_2: 2%7D%0A    translation = QFlexCircuit.translate_cirq_to_qflex(cirq_circuit=circuit,%0A                                                       qubit_to_index_dict = qubits_to_index_dict)%0A%0A    assert(translation.strip() == %22%5Cn%22.join(file_lines))%0A%0A%0A%0A

test cirq -> qflex