def export_circuit(): data = request.json option = data["option"] circuit = data["circuit"] try: wrapper = CircuitWrapper(qiskit_instructions=circuit) if option.lower() == "quil": output = wrapper.export_quil() elif option.lower() == "pyquil": output = wrapper.export_pyquil() elif option.lower() == "openqasm": output = wrapper.export_qasm() elif option.lower() == "qiskit": output = wrapper.export_qiskit_commands() else: return "Bad Request!", 400 except Exception as e: print(str(e)) return str(e), 500 return output
def test_pyquil_export(self): wrapper = CircuitWrapper(qiskit_circuit=qiskit_custom()) pyquil = wrapper.export_pyquil() print(pyquil)