mirror of https://github.com/Qiskit/qiskit-aer.git
Fix issue 2084 again (#2119)
* Fix issue 2084 again * format * fix test * fix test
This commit is contained in:
parent
7b9371914d
commit
83c14459c7
|
@ -352,7 +352,7 @@ class AerBackend(Backend, ABC):
|
|||
|
||||
def set_max_qubits(self, max_qubits):
|
||||
"""Set maximun number of qubits to be used for this backend."""
|
||||
if self._target is not None:
|
||||
if self._target is None:
|
||||
self._configuration.n_qubits = max_qubits
|
||||
|
||||
def clear_options(self):
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed issue #2084 again. `backend.set_max_qubits` was not
|
||||
properly implemented.
|
||||
Also added test case to test this issue.
|
||||
|
|
@ -270,6 +270,16 @@ class TestSampler(QiskitAerTestCase):
|
|||
result = Sampler().run(qc, shots=100).result()
|
||||
self.assertDictAlmostEqual(result.quasi_dists[0], {0: 1})
|
||||
|
||||
def test_truncate_large_circuit(self):
|
||||
"""Test trancate large circuit in transplier"""
|
||||
sampler = Sampler()
|
||||
qc = QuantumCircuit(100, 2)
|
||||
qc.h(98)
|
||||
qc.cx(98, 99)
|
||||
qc.measure([98, 99], [0, 1])
|
||||
result = sampler.run(qc).result()
|
||||
self.assertIsInstance(result, SamplerResult)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue