-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
748b801
commit 7a8f177
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
releasenotes/notes/translate-subexperiments-08be7848b440f6ed.yaml
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,4 @@ | ||
--- | ||
features: | ||
- | | ||
The functions, :func:`.generate_qpd_experiments` and :func:`decompose_qpd_instructions`, now accept an optional argument, ``translate_to_qpu``, which accepts a string denoting whether the instructions sampled for cutting should be translated to a particular QPU architecture. Accepted inputs are: ``{"heron", "eagle"}``. |
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,43 @@ | ||
# This code is a Qiskit project. | ||
|
||
# (C) Copyright IBM 2024. | ||
|
||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE.txt file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
|
||
"""Tests for CKT equivalence libraries.""" | ||
|
||
import unittest | ||
|
||
import numpy as np | ||
from qiskit.circuit import EquivalenceLibrary | ||
from qiskit.circuit.library.standard_gates import SdgGate | ||
|
||
|
||
from circuit_knitting.utils.equivalence import equivalence_libraries | ||
|
||
|
||
class TestEquivalenceLibraries(unittest.TestCase): | ||
def setUp(self): | ||
self.heron_lib = equivalence_libraries["heron"] | ||
self.eagle_lib = equivalence_libraries["eagle"] | ||
self.standard_lib = equivalence_libraries["standard"] | ||
|
||
def test_equivalence_library_dict(self): | ||
assert isinstance(self.heron_lib, EquivalenceLibrary) | ||
assert isinstance(self.eagle_lib, EquivalenceLibrary) | ||
assert self.standard_lib == None | ||
|
||
def test_equivalence_heron(self): | ||
heron_equivalence = self.heron_lib.get_entry(SdgGate())[0] | ||
assert heron_equivalence.data[0].operation.name == "rz" | ||
assert heron_equivalence.data[0].operation.params == [-np.pi / 2] | ||
|
||
def test_equivalence_eagle(self): | ||
eagle_equivalence = self.eagle_lib.get_entry(SdgGate())[0] | ||
assert eagle_equivalence.data[0].operation.name == "rz" | ||
assert eagle_equivalence.data[0].operation.params == [-np.pi / 2] |