Skip to content

Commit

Permalink
add pyqasm v2 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGupta2012 authored Oct 22, 2024
1 parent 93df9de commit 29b8836
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Discord = "https://discord.gg/TPBU2sa8Et"

[project.optional-dependencies]
cirq = ["cirq-core>=1.3.0,<1.5.0"]
qasm3 = ["pyqasm==0.0.1", "numpy"]
qasm3 = ["pyqasm==0.0.2", "numpy"]
test = ["qbraid>=0.7.1,<0.9.0", "pytest", "pytest-cov", "autoqasm>=0.1.0"]
lint = ["black", "isort", "pylint", "qbraid-cli>=0.8.7"]
docs = ["sphinx>=7.3.7,<=8.3.0", "sphinx-autodoc-typehints>=1.24,<2.6", "sphinx-rtd-theme>=2.0,<3.1", "docutils<0.22", "sphinx-copybutton"]
Expand Down
3 changes: 1 addition & 2 deletions qbraid_qir/qasm3/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def qasm3_to_qir(
elif not isinstance(program, str):
raise TypeError("Input quantum program must be of type openqasm3.ast.Program or str.")

qasm3_module = pyqasm.unroll(program)

qasm3_module = pyqasm.unroll(program, as_module=True)
if name is None:
name = generate_module_id()
llvm_module = qir_module(Context(), name)
Expand Down
2 changes: 1 addition & 1 deletion tests/qasm3_qir/converter/test_barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_barrier():
qubit q3;
bit[2] c;
bit c2;
bit[1] c2;
// Only full barrier supported in QIR
Expand Down
2 changes: 1 addition & 1 deletion tests/qasm3_qir/converter/test_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_measure():
qubit q3;
bit[2] c1;
bit c2;
bit[1] c2;
// supported
c1 = measure q1;
Expand Down
4 changes: 2 additions & 2 deletions tests/qasm3_qir/converter/test_quantum_decl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_clbit_declarations():
qasm3_string = """
OPENQASM 3;
include "stdgates.inc";
bit c1;
bit[1] c1;
bit[2] c2;
creg c3[3];
bit[1] c4;
Expand All @@ -65,7 +65,7 @@ def test_qubit_clbit_declarations():
qubit[1] q4;
// clbit declarations
bit c1;
bit[1] c1;
bit[2] c2;
creg c3[3];
bit[1] c4;
Expand Down

0 comments on commit 29b8836

Please sign in to comment.