Skip to content

Commit

Permalink
Remove delay_noise option from AerSimulator.from_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
itoko committed Dec 6, 2021
1 parent 435be1b commit 053130f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions qiskit/providers/aer/backends/aer_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,9 @@ def from_backend(cls, backend, **options):
# Avoid cyclic import
from ..noise.noise_model import NoiseModel

if 'delay_noise' in options:
noise_model = NoiseModel.from_backend(backend, delay_noise=options['delay_noise'])
del options['delay_noise']
if not noise_model.is_ideal():
options['noise_model'] = noise_model
noise_model = NoiseModel.from_backend(backend)
if not noise_model.is_ideal():
options['noise_model'] = noise_model

# Initialize simulator
sim = cls(configuration=configuration,
Expand Down
2 changes: 1 addition & 1 deletion test/terra/noise/test_noise_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_delay_noise(self):
result = AerSimulator().run(qc, noise_model=noise_model).result()
self.assertTrue(result.success)
# test another path
noisy_sim = AerSimulator().from_backend(backend, delay_noise=True)
noisy_sim = AerSimulator().from_backend(backend)
qc = transpile(circ, noisy_sim, scheduling_method="alap")
result = noisy_sim.run(qc).result()
self.assertTrue(result.success)
Expand Down

0 comments on commit 053130f

Please sign in to comment.