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

Commit

Permalink
readjust test_convert_id_to_delay (#739)
Browse files Browse the repository at this point in the history
* readjust test_convert_id_to_delay

* disable not-context-manager

* duplicated entry
  • Loading branch information
1ucian0 authored Sep 27, 2023
1 parent 81ded48 commit d22d875
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

# 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

0 comments on commit d22d875

Please sign in to comment.