Changelog
Prelude
- Qiskit Nature 0.5 comes with a major redesign of the [BaseProblem](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.problems.BaseProblem.html#qiskit_nature.second_q.problems.BaseProblem) layer of its stack. Rather than tightly integrating drivers and transformers, problems are now a lot more standalone and are generated by the various drivers (or built out by a user to their custom needs directly).
New Features
- The algorithms module now requires the new algorithms introduced in Qiskit Terra 0.22 which in turn rely on the [Qiskit Primitives](https://qiskit.org/documentation/apidoc/primitives.html) themselves. For more details check out the [migration guide for problem solving](https://qiskit.org/documentation/nature/migration/00a_Solving_problems_with_0.5.ipynb).
- The refactoring of the electronic structure stack has enabled the development of third-party plugins allowing classical codes to call Qiskit Nature instead of relying on the development of drivers in the Qiskit Nature package. One example is the new [Qiskit Nature PySCF Plugin](https://github.com/qiskit-community/qiskit-nature-pyscf) which can be used. Qiskit Nature still provides drivers to enable simple testing and provide a more accessible entry to Qiskit Nature for users who do not come from a classical chemistry computing background. Check out the [migration guide for electronic structure calculations](https://qiskit.org/documentation/nature/migration/00b_Electronic_structure_with_0.5.ipynb) to learn how to update your code to use the refactored drivers.
- The properties concept has been largely redesigned and is a lot more refined now. Instead of being a “catchall” for operator factories, the module has been cleanly separated into various components. Check out the corresponding section of the [migration guide for electronic structure calculations](https://qiskit.org/documentation/nature/migration/00b_Electronic_structure_with_0.5.ipynb) for more details.
- The vibrational structure stack has been refactored in-line with the changes to the electronic structure stack mentioned previously. However, changes to this stack also include corrections to the differentiation of real-space and second-quantized coefficients of the Watson hamiltonian. For more details, check out the [migration guide for vibrational structure calculations](https://qiskit.org/documentation/nature/migration/00c_Vibrational_structure_with_0.5.ipynb).
- The lattices and related LatticeModel classes have undergone some API changes, particularly around the location of the utility methods for uniform lattice generation. For more details check out the [migration guide for lattice models](https://qiskit.org/documentation/nature/migration/00d_Lattice_models_with_0.5.ipynb).
- Added the qiskit_nature.second_q.properties.HeisenbergModel which implements the Hamiltonian of the Heisenberg model. This model is used in the study of critical points and phase transitions of magnetic systems. Through the choice of the model constants and the external magnetic field, we can produce many models like: XYZ, XXX, Ising model and others.
- Adds .SparseLabelOp.equiv for checking approximate equality between two SparseLabelOps.
- The performance of the following mappers, when used to map multiple operators of identical size, is significantly improved, by means of caching internal structures
- Adds a new Property for the electronic structure stack to evaluate the 1- and 2-body reduced density matrices. Assuming that you already have an instance of your [qiskit_nature.second_q.problems.ElectronicStructureProblem](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.problems.ElectronicStructureProblem.html#qiskit_nature.second_q.problems.ElectronicStructureProblem), you can add the [qiskit_nature.second_q.properties.ElectronicDensity](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.properties.ElectronicDensity.html#qiskit_nature.second_q.properties.ElectronicDensity)
- Adds the [PropertiesContainer](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.problems.PropertiesContainer.html#qiskit_nature.second_q.problems.PropertiesContainer) and its subclasses to simplify the handling of SparseLabelOpsFactory instances inside of problems. This container is a MutableSet and enforces at most a single instance of any Property kind to be stored inside of it This is sufficient for all application purposes of the auxiliary operators (which are generated by these objects).
- Adds the new keyword argument mirror to the [SUCCD](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.circuit.library.SUCCD.html#qiskit_nature.second_q.circuit.library.SUCCD) ansatz, which allows the inclusion of symmetrically mirrored double excitations while preserving the number of circuit parameters.
- Adds support for the [QCSchema](https://molssi-qc-schema.readthedocs.io/en/latest/index.html) via which we aim to standardize the I/O between classical drivers and Qiskit Nature.
- Implements both [HartreeFock](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.circuit.library.HartreeFock.html#qiskit_nature.second_q.circuit.library.HartreeFock) and [VSCF](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.circuit.library.VSCF.html#qiskit_nature.second_q.circuit.library.VSCF) as subclasses of BlueprintCircuit. This allows the respective classes to be instantiated without explicitly setting all of their instance attributes. Missing attributes can be set at a later point to complete the respective circuit definitions.
- The new [qiskit_nature.second_q.operators.FermionicOp](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.FermionicOp.html#qiskit_nature.second_q.operators.FermionicOp) replaces the old qiskit_nature.operators.second_quantization.operators.FermionicOp. This new operator is a subclass of the [qiskit_nature.second_q.operators.SparseLabelOp](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.SparseLabelOp.html#qiskit_nature.second_q.operators.SparseLabelOp) and, as such, only support sparse labels. It is initialized with a dictionary, mapping sparse label keys to coefficients. It supports the usual algebra for operator addition, scalar multiplication, operator composition, operator tensoring, and complex conjugation. It also provides methods for sorting, equality and equivalency checking, operator simplification, normal ordering, and the computation of induced norms as well as hermiticity properties. Finally, it can also be converted to matrices in the occupation number basis.
- Added the xcf argument to the [qiskit_nature.second_q.drivers.GaussianForcesDriver.from_molecule()](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.drivers.GaussianForcesDriver.from_molecule.html#qiskit_nature.second_q.drivers.GaussianForcesDriver.from_molecule) which allows specifying the exchange-correlation functional to be used by Gaussian.
- The excitation_list property has been removed from [HFInitialPoint](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint.html#qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint), [MP2InitialPoint](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint.html#qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint), and [VSCFInitialPoint](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.VSCFInitialPoint.html#qiskit_nature.second_q.algorithms.initial_points.VSCFInitialPoint). Thus the excitation list cannot be set directly, rather this must be set via the [ansatz](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.InitialPoint.ansatz.html#qiskit_nature.second_q.algorithms.initial_points.InitialPoint.ansatz).
- Following the MP2 T2 and energy correction calculation fix, the APIs for [MP2InitialPoint](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint.html#qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint) and [HFInitialPoint](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint.html#qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint) have been changed slightly. After setting the grouped_property, the total_energy and energy_correction are now accessed via their respective properties, rather than via get_energy and get_energy_correction.
- Adds atol parameter to SparseLabelOp.is_hermitian().
- The supported excitation types in the QEOM code have been updated. It now exposes the full set of excitation generation functionalities provided by the internally used UCC and UVCC ansatze. In particular, this means that rather than providing a custom list of excitation tuples, a function can be set by the user which generates such a custom list. The documentation has been updated accordingly to reflect this in all places.
- Adds [SparseLabelOp.induced_norm()](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.SparseLabelOp.induced_norm.html#qiskit_nature.second_q.operators.SparseLabelOp.induced_norm).
- Changes usage of library retworkx to the new substitute rustworkx.
- Adds utility functions for converting between chemists’ and physicists’ index ordering for two-body integrals. [qiskit_nature.second_q.operators.tensor_ordering.to_chemist_ordering()](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.tensor_ordering.to_chemist_ordering.html#qiskit_nature.second_q.operators.tensor_ordering.to_chemist_ordering) converts from physicists’ or intermediate order to chemists’, whereas [qiskit_nature.second_q.operators.tensor_ordering.to_physicist_ordering()](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.tensor_ordering.to_physicist_ordering.html#qiskit_nature.second_q.operators.tensor_ordering.to_physicist_ordering) converts to physicists’. [qiskit_nature.second_q.operators.tensor_ordering.find_index_order()](https://qiskit.org/documentation/nature/stubs/qiskit_nature.second_q.operators.tensor_ordering.find_index_order.html#qiskit_nature.second_q.operators.tensor_ordering.find_index_order) returns the index-order type for a given two-body tensor.