Skip to content

Unittest not running because QiskitTestCase class is removed in Qiskit 1.0. #98

@sim-eng-ii

Description

@sim-eng-ii

Information

  • Qiskit Cold atoms version:latest
  • Python version: Python 3.12.3
  • Operating system: macOS

What is the current behavior?

As per issue #97, the qiskit-terra (>=0.17.1) dependencies need to be removed. I have also noticed that the unittest files depend on the qiskit.test class QiskitTestCase, which is not available in Qiskit 1.0 and beyond.

Steps to reproduce the problem

  • Create a virtual environment
  • Install the latest version of Qiskit 1.0 and necessary qiskit libraries (e.g. qiskit_are, qiskit-nature, qiskit-algorithms)
  • Update lines 26 and 27 of qiskit_cold_atom/applications/time_evolution_solver.py to:
            from qiskit_algorithms import TimeEvolutionProblem
            from qiskit_algorithms.time_evolvers import TrotterQRTE

(this change will ensure the use of the qiskit-algorithm rather than the deprecated qiskit.algorithm.

  • run python -m unittest in the root folder
  • The error displayed is:
            From qiskit.test import QiskitTestCase
        ModuleNotFoundError: No module named 'qiskit.test'

This is because qiskit.test class QiskitTestCase is not defined in Qiskit 1.0

What is the expected behavior?

Unittests should run and either pass or fail.

Suggested solutions

[update at on 3/09/24 at 16:43GMT on possible solution]

  • remove qiskit.test from qiskit-cold-atom and use an alternative method

I think this problem should be addressed before (or while) resolving issue #97

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions