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

Add pyqasm v0.0.2 #181

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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