Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

readjust test_convert_id_to_delay #739

Merged
merged 3 commits into from
Sep 27, 2023
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
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ disable=arguments-renamed, # more readable and clear
too-many-public-methods, # too verbose
too-many-statements, # too verbose
unnecessary-pass, # allow for methods with just "pass", for clarity
not-context-manager, # terra is not fully type-safe
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qiskit is not fully typed, so trusting its type coming out of qiskit-land is sometimes too strong.


# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
8 changes: 4 additions & 4 deletions test/unit/transpiler/passes/basis/test_convert_id_to_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def test_c_if_id_gate(self):
"""Test if c_if Id gate is converted a c_if delay."""
qc = QuantumCircuit(1, 1)

qc.id(0).c_if(0, 1)
with qc.if_test((0, 1)):
qc.id(0)

pm = PassManager([ConvertIdToDelay(self.durations)])
transformed = pm.run(qc)

expected = QuantumCircuit(1, 1)
expected.delay(160, 0)
# Delay does not officially support condition
expected.data[0].operation.condition = qc.data[0].operation.condition
with expected.if_test((0, 1)):
expected.delay(160, 0)

self.assertEqual(expected, transformed)

Expand Down
Loading