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

Update parameters to accommodate with RZZ constraints #2126

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7dbfe26
wrote a test for rzz conversion
yaelbh Feb 4, 2025
0aee8a7
switching to pubs
yaelbh Feb 5, 2025
1f19512
a beginning of the change in the pub
yaelbh Feb 6, 2025
4be8666
global phase done
yaelbh Feb 6, 2025
763da6c
fixes
yaelbh Feb 6, 2025
b2b157c
fixed test
yaelbh Feb 6, 2025
e660cb8
handling rz, rx, rzz and removing global phase
yaelbh Feb 6, 2025
95f60a5
update test to ignore global phase
yaelbh Feb 6, 2025
cfa60ef
black
yaelbh Feb 6, 2025
7fd4b34
black
yaelbh Feb 6, 2025
b4d6729
lint
yaelbh Feb 6, 2025
aa29a71
some fixes
yaelbh Feb 6, 2025
b50a77a
bug fix
yaelbh Feb 6, 2025
64683c2
preparing to test many inputs
yaelbh Feb 6, 2025
a86051e
test more cases
yaelbh Feb 6, 2025
b059808
make the test a bit more interesting; still need to implement for dyn…
yaelbh Feb 6, 2025
b29cd64
enhanced test
yaelbh Feb 9, 2025
2334016
beginning of a test of dynamic (still missing testing of qubit indices)
yaelbh Feb 9, 2025
27e432a
skip test of dynamic circuits
yaelbh Feb 9, 2025
337039d
remove debug prints
yaelbh Feb 9, 2025
cb0a21c
black
yaelbh Feb 9, 2025
1c09dc3
lint
yaelbh Feb 9, 2025
7a4aa09
lint
yaelbh Feb 9, 2025
f873e69
Merge branch 'main' into fixrzzpubs
yaelbh Feb 9, 2025
47cad78
lint
yaelbh Feb 9, 2025
ffa3850
mypy
yaelbh Feb 9, 2025
8632e32
accurately copy the circuit's registers
yaelbh Feb 13, 2025
002f79a
lint
yaelbh Feb 13, 2025
6aa30f4
Merge branch 'main' into fixrzzpubs
yaelbh Feb 13, 2025
437e23a
empty commit to rerun CI
yaelbh Feb 17, 2025
aeb7a90
Merge branch 'main' into fixrzzpubs
yaelbh Feb 17, 2025
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
Prev Previous commit
Next Next commit
skip test of dynamic circuits
yaelbh committed Feb 9, 2025
commit 27e432abc93204f9b88f888087345c32d65d74cd
3 changes: 3 additions & 0 deletions test/unit/transpiler/passes/basis/test_fold_rzz_angle.py
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
from ddt import ddt, named_data, data, unpack
import numpy as np
from itertools import chain
import unittest

from qiskit.circuit import QuantumCircuit
from qiskit.circuit.parameter import Parameter
@@ -156,6 +157,7 @@ def test_rzz_pub_conversion(self, p1_set1, p2_set1, p1_set2, p2_set2, expected_n
)
)

@unittest.SkipTest
def test_rzz_pub_conversion_dynamic(self):
"""Test the function `convert_to_rzz_valid_circ_and_vals` for dynamic circuits"""
p = Parameter("p")
@@ -175,6 +177,7 @@ def test_rzz_pub_conversion_dynamic(self):
self.assertEqual(is_valid_rzz_pub(isa_pub), "")
self.assertEqual([observable], isa_pub.observables)

# TODO: test qubit indices
isa_pub_param_names = np.array(list(chain.from_iterable(isa_pub.parameter_values.data)))
self.assertEqual(len(isa_pub_param_names), 6)
for param_name in ["rzz_block1_rx1", "rzz_block1_rx2", "rzz_rx1", "rzz_block2_rx1", "rzz_block2_rx2", "rzz_rx2"]: