Skip to content
Merged
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
11 changes: 10 additions & 1 deletion qiskit_neko/tests/experiments/test_tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,30 @@
# that they have been altered from the originals.

"""Tests for quantum state tomography."""
import unittest

from qiskit_experiments.library import StateTomography
from qiskit import QuantumCircuit
from qiskit.quantum_info import DensityMatrix, state_fidelity

from qiskit_neko import decorators
from qiskit_neko.tests import base
import qiskit


class TestQuantumStateTomography(base.BaseTestCase):
"""Tests adapted from circuit basics tutorial."""

@unittest.skipIf(
tuple(map(int, qiskit.__version__.split(".")[:2])) >= (2, 0),
"Skipping test until Qiskit Experiments is ready for Qiskit 2.0. "
"Tracked in: https://github.com/Qiskit/qiskit-neko/issues/54",
)
Comment on lines +27 to +31
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have just unconditionally skipped this but this is clever and lets us keep running things on 1.4.x and will ensure that experiments doesn't regress/break compatibility with 1.4.x when it's updated.

@decorators.component_attr("terra", "backend", "experiment")
def test_ghz_circuit_quantum_info(self):
"""Test state tomography of ghz state circuit"""

from qiskit_experiments.library import StateTomography

nq = 3
qc_ghz = QuantumCircuit(nq)
qc_ghz.h(0)
Expand Down