Skip to content

Commit

Permalink
Hopefully getting QIR testing supported in CI :D
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-campora committed Feb 3, 2025
1 parent 6a69cf1 commit a0efb67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/quantum-pecos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ all = [
"quantum-pecos[simulators]",
"quantum-pecos[wasm-all]",
"quantum-pecos[visualization]",
"quantum-pecos[qir]",
]
# The following only work for some environments/Python verions:
qulacs = [ # State-vector sims using Qulacs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from pecos import __version__
from pecos.qeclib import qubit as p
from pecos.qeclib.steane.steane_class import Steane
Expand Down Expand Up @@ -89,6 +91,7 @@ def test_bell():
assert SlrConverter(prog).qasm() == qasm


@pytest.mark.optional_dependency
def test_bell_qir():
"""Test that a simple Bell prep and measure circuit can be created."""
prog: Main = Main(
Expand All @@ -103,6 +106,7 @@ def test_bell_qir():
assert "__quantum__qis__h__body" in qir


@pytest.mark.optional_dependency
def test_bell_qreg_qir():
"""Test that a simple Bell prep and measure circuit can be created."""
prog: Main = Main(
Expand Down Expand Up @@ -194,6 +198,7 @@ def test_strange_program():
assert SlrConverter(prog).qasm() == qasm


@pytest.mark.optional_dependency
def test_control_flow_qir():
"""Test a program with control flow into QIR."""

Expand Down Expand Up @@ -230,6 +235,7 @@ def test_control_flow_qir():
assert "__quantum__qis__h__body" in qir


@pytest.mark.optional_dependency
def test_plus_qir():
"""Test a program with addition compiling into QIR."""

Expand All @@ -246,6 +252,7 @@ def test_plus_qir():
assert "add" in qir


@pytest.mark.optional_dependency
def test_nested_xor_qir():
"""Test a program with addition compiling into QIR."""

Expand All @@ -264,6 +271,7 @@ def test_nested_xor_qir():
assert "xor" in qir


@pytest.mark.optional_dependency
def test_minus_qir():
"""Test a program with addition compiling into QIR."""

Expand All @@ -280,6 +288,7 @@ def test_minus_qir():
assert "sub" in qir


@pytest.mark.optional_dependency
def test_steane_qir():
"""Test the teleportation program using the Steane code."""
print(SlrConverter(telep("X", "X")).qir())

0 comments on commit a0efb67

Please sign in to comment.