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

Add open_pulse to the backend_configuration.to_dict() #2236

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 qiskit_aer/backends/backendconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def to_dict(self):
"max_shots": self.max_shots,
"coupling_map": self.coupling_map,
"dynamic_reprate_enabled": self.dynamic_reprate_enabled,
"open_pulse": self.open_pulse,
}

if hasattr(self, "supported_instructions"):
Expand Down
30 changes: 30 additions & 0 deletions test/terra/backends/test_backend_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This code is part of Qiskit.
#
# (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 Aer BackendConfiguration
"""

from test.terra.common import QiskitAerTestCase

from ddt import data, ddt
from qiskit_aer.backends import AerSimulator, QasmSimulator, StatevectorSimulator, UnitarySimulator


@ddt
class TestBackendConfiguration(QiskitAerTestCase):
"""Tests for Aer BackendConfiguration."""

@data(AerSimulator(), StatevectorSimulator(), QasmSimulator(), UnitarySimulator())
def test_open_pulse_in_backend_configuration(self, simulator: str):
"""Test that open_pulse is part of backend_configuration"""
assert simulator.configuration().open_pulse is False
assert simulator.configuration().to_dict()["open_pulse"] is False
Loading