Repository: qBraid/qBraid (language: python)

Issue:
Fix transpiler test failures resulting from qiskit upgrade
Depandabot PR https://github.com/qBraid/qBraid/pull/732 to update qiskit requirement from <1.2,>=0.44 to >=0.44,<1.3 is failing tests. See actions [traceback](https://github.com/qBraid/qBraid/actions/runs/10473664093/job/29006035156?pr=732).

Please diagnose and fix to allow updating qiskit requirement.
Update qiskit requirement from <1.2,>=0.44 to >=0.44,<1.3
Updates the requirements on [qiskit](https://github.com/Qiskit/qiskit) to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Qiskit/qiskit/releases">qiskit's releases</a>.</em></p>
<blockquote>
<h2>Qiskit  1.2.0</h2>
<p>Release notes: <a href="https://docs.quantum.ibm.com/api/qiskit/release-notes/1.2">https://docs.quantum.ibm.com/api/qiskit/release-notes/1.2</a></p>
<h1>Changelog</h1>
<h2>Deprecated</h2>
<ul>
<li>Deprecate BackendV1 and <code>qiskit.providers.models</code> (backport <a href="https://redirect.github.com/Qiskit/qiskit/issues/12629">#12629</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12864">#12864</a>)</li>
<li>Deprecate fake backends based on BackendV1 (backport <a href="https://redirect.github.com/Qiskit/qiskit/issues/12660">#12660</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12837">#12837</a>)</li>
<li>fixes <a href="https://redirect.github.com/Qiskit/qiskit/issues/9355">#9355</a> deprecate visualize_transition (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12287">#12287</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12822">#12822</a>)</li>
<li>Deprecate V1 Primitives and their utils (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12575">#12575</a>)</li>
<li>Deprecate Qobj and assemble (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12649">#12649</a>)</li>
<li>Deprecate accidentally public internal helper methods on QuantumCircuit (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12785">#12785</a>)</li>
<li>Improve the performance of the <code>ProductFormula</code> synthesizers (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12724">#12724</a>)</li>
<li>Add warning for bad <code>justify</code> input, in <code>circuit_drawer</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12458">#12458</a>)</li>
<li>Deprecate tuple-like access to <code>CircuitInstruction</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12640">#12640</a>)</li>
</ul>
<h2>Added</h2>
<ul>
<li>'Peephole' optimization - or: collecting and optimizing two-qubit blocks - before routing (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12727">#12727</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12881">#12881</a>)</li>
<li>Avoid operator creation in transpiler (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12826">#12826</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12875">#12875</a>)</li>
<li>Port <code>star_preroute</code> to rust (backport <a href="https://redirect.github.com/Qiskit/qiskit/issues/12761">#12761</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12846">#12846</a>)</li>
<li>Add config option to leverage all cores for sabre (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12780">#12780</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12841">#12841</a>)</li>
<li>Bitarray postselect (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12693">#12693</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12836">#12836</a>)</li>
<li>Add <code>AnnotatedOperation.params</code> and fix some control issues (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12752">#12752</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12828">#12828</a>)</li>
<li>Move <code>generate_preset_pass_manager</code> to a standalone file (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12762">#12762</a>)</li>
<li>Update version of OpenQASM 3.0 standard library (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12387">#12387</a>)</li>
<li>Port <code>synth_permutation_depth_lnn_kms</code> to Rust (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12746">#12746</a>)</li>
<li>Rewrite OpenQASM 3 exporter symbol table (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12776">#12776</a>)</li>
<li>Port <code>synth_clifford_bm</code> to Rust. (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12714">#12714</a>)</li>
<li>Update MCX recursive synthesis method to reduce number of CX gates  (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12772">#12772</a>)</li>
<li>Barebone generic backend options (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12747">#12747</a>)</li>
<li>Adding QFT gate to natively reason about Quantum  Fourier Transforms (<a href="https://redirect.github.com/Qiskit/qiskit/issues/11463">#11463</a>)</li>
<li>Improve the performance of the <code>ProductFormula</code> synthesizers (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12724">#12724</a>)</li>
<li>Improved MCXVChain with dirty auxiliary qubits (<a href="https://redirect.github.com/Qiskit/qiskit/issues/9687">#9687</a>)</li>
<li>Oxidize <code>synth_cnot_count_full_pmh</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12588">#12588</a>)</li>
<li>Add Uniform State Preparation (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12112">#12112</a>)</li>
<li>Port <code>synth_clifford_greedy</code> to Rust (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12601">#12601</a>)</li>
<li>Oxidize <code>synth_permutation_acg</code>  (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12543">#12543</a>)</li>
<li>improving <code>quantum_causal_cone</code> method in python (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12668">#12668</a>)</li>
<li>binary matrices utils in rust (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12456">#12456</a>)</li>
<li>Add infrastructure for gates, instruction, and operations in Rust (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12459">#12459</a>)</li>
<li>Add option to user config to control <code>idle_wires</code> in circuit drawer (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12462">#12462</a>)</li>
<li>[unitaryHACK] Controlling the Insertion of Multi-Qubit Gates in the Generation of Random Circuits <a href="https://redirect.github.com/Qiskit/qiskit/issues/12059">#12059</a> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12483">#12483</a>)</li>
<li>Add <strong>pos</strong> for Parameter (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12496">#12496</a>)</li>
<li>Update <code>transpile()</code> and <code>generate_preset_pass_manager</code> to convert loose input of constraints to a <code>Target</code> with <code>Target.from_configuration()</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12185">#12185</a>)</li>
<li>Add <code>DenseLayout</code> trial to <code>SabreLayout</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12453">#12453</a>)</li>
<li>add insert_barrier argument to UnitaryOverlap (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12321">#12321</a>)</li>
<li>Add new method for single bitstring target when measuring stabilizerstate probabilities_dict (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12147">#12147</a>)</li>
<li>Replace initialization method by Isometry in StatePreparation (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12178">#12178</a>)</li>
</ul>
<h2>Changed</h2>
<ul>
<li>Update metadata of Primitives V2 (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12784">#12784</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12857">#12857</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Qiskit/qiskit/blob/1.2.0/docs/release_notes.rst">qiskit's changelog</a>.</em></p>
<blockquote>
<p>.. _release-notes:</p>
<h1>==============================
Qiskit |version| release notes</h1>
<p>..
These release notes get converted into Markdown files via the infrastructure at <a href="https://github.com/Qiskit/documentation">https://github.com/Qiskit/documentation</a>, which then gets deployed to <a href="https://docs.quantum.ibm.com/api/qiskit/release-notes">https://docs.quantum.ibm.com/api/qiskit/release-notes</a>. Changes to these release notes will update those release notes the next time the API docs are generated for this version.</p>
<pre><code>`:earliest-version:` should be set to the rc1 release for the current minor release series. For example, the stable/1.1 branch should set it to 1.1.0rc1. If on `main`, set to the prior minor version's rc1, like `1.0.0rc1`.
</code></pre>
<p>.. release-notes::
:earliest-version: 1.2.0rc1</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Qiskit/qiskit/commit/7e2e835e17b98da2d3b9a2a27de598cf5d2607ed"><code>7e2e835</code></a> Internally importing <code>qiskit.providers.backend.Backend</code> should not raise `Dep...</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/443ece54217a76a2548cf44bc48ca9bd59153ae9"><code>443ece5</code></a> Prepare 1.2.0 release (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12933">#12933</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/eff654f9a455353b91d7ea67a2188e87f8da9d78"><code>eff654f</code></a> Allow immutable borrow to access <code>QuantumCircuit.parameters</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12918">#12918</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12958">#12958</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/5f227a0e48ce1865c4800a82b4614aed8e88cc6e"><code>5f227a0</code></a> Fix error message upon misalignment in <code>PadDynamicalDecoupling</code> (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12952">#12952</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12">#12</a>...</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/75e29d77bb5734c9f6fdc8f310b9a98a2cd54167"><code>75e29d7</code></a> Fix version parsing issue in bloch.py. (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12928">#12928</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12947">#12947</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/8e05de20c4248776b936c30306ce1283d061a82b"><code>8e05de2</code></a> Improve error message on bad OpenQASM 3 <code>basis_gates</code> argument (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12945">#12945</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12946">#12946</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/8673309e8d19c4748377991a8591e7532978762e"><code>8673309</code></a> Fix dag visualization with Var wires (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12848">#12848</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12924">#12924</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/4899f26d10d648f092ba22f6465e5aae27d23981"><code>4899f26</code></a> Remove init peephole optimization discrete basis check (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12898">#12898</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12920">#12920</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/3e88060a49188e6b2439aef2a1b5523e7cd47755"><code>3e88060</code></a> Fix short circuit detection for basis translator (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12899">#12899</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12921">#12921</a>)</li>
<li><a href="https://github.com/Qiskit/qiskit/commit/f1034e9c014a1ba705f0298c4c61102d0111b5cc"><code>f1034e9</code></a> Update docs links for new URL structure (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12896">#12896</a>) (<a href="https://redirect.github.com/Qiskit/qiskit/issues/12897">#12897</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Qiskit/qiskit/compare/0.45.0rc1...1.2.0">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d86d6df5..e12c8ee0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ Types of changes:
 - Renamed `qbraid.runtime.GateModelJobResult.raw_counts` $\rightarrow$ `get_counts` ([#735](https://github.com/qBraid/qBraid/pull/735))
 - Updated `qbraid.runtime.TargetProfile` for more idiomatic usage of `pydantic.BaseModel` for field validation and property access ([#735](https://github.com/qBraid/qBraid/pull/735))
 - `qbraid.runtime.GateModelJobResult.measurements` now returns `None` by default instead of being abstract method. ([#735](https://github.com/qBraid/qBraid/pull/735))
+- Bumped qiskit dependency to qiskit>=0.44,<1.3 ([#737](https://github.com/qBraid/qBraid/pull/737))
 
 ### Deprecated
 
diff --git a/pyproject.toml b/pyproject.toml
index c5ecf29fd..f17d6626b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -50,7 +50,7 @@ pennylane = ["pennylane<0.38"]
 pyquil = ["pyquil>=4.4"]
 pytket = ["pytket>=1.31"]
 qir = ["qbraid-qir>=0.2"]
-qiskit = ["qiskit>=0.44,<1.2", "qiskit-ibm-runtime>=0.25.0,<0.29", "qiskit-qasm3-import>=0.4.2", "qiskit-qir>=0.5.0"]
+qiskit = ["qiskit>=0.44,<1.3", "qiskit-ibm-runtime>=0.25.0,<0.29", "qiskit-qasm3-import>=0.4.2", "qiskit-qir>=0.5.0"]
 visualization = ["ipython", "matplotlib", "pylatexenc"]
 test = ["pytest", "pytest-cov", "sympy"]
 lint = ["black", "isort", "pylint", "qbraid-cli>=0.8.2"]
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 6ecb4398a..4eeecf668 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -4,7 +4,7 @@ cirq-core>=1.3,<1.5
 pennylane<0.38
 pyquil>=4.4; python_version < "3.12"
 pytket>=1.31; python_version >= "3.10"
-qiskit>=0.44,<1.2
+qiskit>=0.44,<1.3
 
 # transpiler extras
 ply>=3.6


Test patch:
diff --git a/tests/programs/test_interface.py b/tests/programs/test_interface.py
index 7b709879d..af7c0a686 100644
--- a/tests/programs/test_interface.py
+++ b/tests/programs/test_interface.py
@@ -64,14 +64,20 @@ def test_qasm3_zero_value_raises(param):
         random_circuit("qasm3", **params)
 
 
-@pytest.mark.parametrize("package", ["qiskit", "cirq"])
-def test_random_circuit_raises_for_bad_params(package: str, available_targets):
+@pytest.mark.parametrize(
+    "package, err_msg",
+    [
+        ("qiskit", "negative dimensions are not allowed"),
+        ("cirq", "Failed to create Cirq random circuit"),
+    ],
+)
+def test_random_circuit_raises_for_bad_params(package: str, err_msg: str, available_targets):
     """Test that _cirq_random raises a QbraidError for invalid parameters."""
     if package not in available_targets:
         pytest.skip(f"{package} not installed")
 
-    expected_err = f"Failed to create {package.capitalize()} random circuit"
-    with pytest.raises(QbraidError, match=expected_err):
+    err_type = QbraidError if package == "cirq" else ValueError
+    with pytest.raises(err_type, match=err_msg):
         random_circuit(package, num_qubits=-1)
 
 
diff --git a/tests/transpiler/qasm/test_qasm2_to_qasm3.py b/tests/transpiler/qasm/test_qasm2_to_qasm3.py
index 4d0ab9575..f6bee826e 100644
--- a/tests/transpiler/qasm/test_qasm2_to_qasm3.py
+++ b/tests/transpiler/qasm/test_qasm2_to_qasm3.py
@@ -153,7 +153,7 @@ def _generate_valid_qasm_strings(seed=42, gates_to_skip=None, num_circuits=100):
     """Returns a list of 100 random qasm2 strings
     which do not contain any of the gates in gates_to_skip
 
-    Current list of invalid gates is ["u", "cu1", "cu2", "cu3", "rxx"]
+    Current list of invalid gates is ["u", "cu1", "cu2", "cu3", "rxx", "xx_minus_yy"]
     For the motivation, see discussion
     - https://github.com/Qiskit/qiskit-qasm3-import/issues/12
     - https://github.com/Qiskit/qiskit-qasm3-import/issues/11#issuecomment-1568505732
@@ -180,7 +180,9 @@ def _generate_valid_qasm_strings(seed=42, gates_to_skip=None, num_circuits=100):
     return qasm_strings
 
 
-@pytest.mark.parametrize("qasm2_str", _generate_valid_qasm_strings(gates_to_skip=["r"]))
+@pytest.mark.parametrize(
+    "qasm2_str", _generate_valid_qasm_strings(gates_to_skip=["r", "xx_minus_yy"])
+)
 def test_random_conversion_to_qasm3(qasm2_str):
     """test random gates conversion"""
     qasm3_str = qasm2_to_qasm3(qasm2_str)
diff --git a/tests/transpiler/qiskit/test_conversions_qiskit.py b/tests/transpiler/qiskit/test_conversions_qiskit.py
index 5738f04b0..63bcb63ab 100644
--- a/tests/transpiler/qiskit/test_conversions_qiskit.py
+++ b/tests/transpiler/qiskit/test_conversions_qiskit.py
@@ -234,7 +234,9 @@ def test_100_random_qiskit():
     for _ in range(100):
         qiskit_circuit = random_circuit(4, 1)
         cirq_circuit = transpile(qiskit_circuit, "cirq", require_native=True)
-        assert circuits_allclose(qiskit_circuit, cirq_circuit, strict_gphase=False)
+        assert circuits_allclose(
+            qiskit_circuit, cirq_circuit, strict_gphase=False, index_contig=True
+        )
 
 
 def test_qiskit_to_from_qasm3():