-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some test and migrated to qiskit 1.0.1
- Loading branch information
Giacomo Antonioli
committed
Feb 28, 2024
1 parent
6e961c7
commit 7261171
Showing
18 changed files
with
1,536 additions
and
439 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
__author__ = """Giacomo Antonioli""" | ||
__email__ = "giacomo.antonioli@phd.unipi.it" | ||
__version__ = "0.1.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import qiskit | ||
from qiskit import QuantumRegister, QuantumCircuit | ||
from qimp.Filters import Gates | ||
import pytest | ||
from qimp.ImageEncoding.QuantumImage import QuantumImage | ||
|
||
def test_make_sum_gate(): | ||
"""Test the make_sum_gate function.""" | ||
expected_circuit = QuantumCircuit(QuantumRegister(1, "c"), QuantumRegister(1, "a"), QuantumRegister(1, "b"), name="Sum") | ||
expected_circuit.cx(1, 2) | ||
expected_circuit.cx(0, 2) | ||
|
||
result = Gates.make_sum_gate() | ||
|
||
assert result == expected_circuit | ||
|
||
def test_make_carry_gate(): | ||
"""Test the make_carry_gate function.""" | ||
expected_circuit = QuantumCircuit(QuantumRegister(1, "c"), QuantumRegister(1, "a"), QuantumRegister(1, "b"), QuantumRegister(1, "c[i+1]"), name="Carry") | ||
expected_circuit.ccx(1, 2, 3) | ||
expected_circuit.cx(1, 2) | ||
expected_circuit.ccx(0, 2, 3) | ||
|
||
result = Gates.make_carry_gate() | ||
|
||
assert result == expected_circuit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Tests for `qimp` module.""" | ||
import qimp | ||
from typing import Generator | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def version() -> Generator[str, None, None]: | ||
"""Sample pytest fixture.""" | ||
yield qimp.__version__ | ||
|
||
|
||
def test_version(version: str) -> None: | ||
"""Sample pytest test function with the pytest fixture as an argument.""" | ||
assert version == "0.1.0" |
Oops, something went wrong.