├── .editorconfig
├── .git-blame-ignore-revs
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── BUG_REPORT.yaml
│ └── FEATURE_REQUEST.yaml
├── PULL_REQUEST_TEMPLATE.md
├── actions
│ ├── install-main-dependencies
│ │ └── action.yml
│ ├── install-nature
│ │ └── action.yml
│ ├── install-psi4
│ │ └── action.yml
│ └── run-tests
│ │ └── action.yml
├── dependabot.yml
├── problem_matchers
│ ├── black.json
│ ├── copyright.json
│ ├── mypy.json
│ ├── pylint.json
│ └── spell.json
└── workflows
│ ├── deploy-code.yml
│ ├── deploy-docs.yml
│ └── main.yml
├── .gitignore
├── .mailmap
├── .mergify.yml
├── .pylintdict
├── .pylintrc
├── .stestr.conf
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── MANIFEST.in
├── Makefile
├── README.md
├── constraints.txt
├── docs
├── Makefile
├── _static
│ ├── co2_vibration.png
│ ├── core-orbitals.png
│ ├── lattice_protein.png
│ ├── orbitals.png
│ └── runtime.png
├── _templates
│ └── autosummary
│ │ ├── base.rst
│ │ ├── class.rst
│ │ ├── class_no_inherited_members.rst
│ │ └── module.rst
├── apidocs
│ ├── qiskit_nature.logging.rst
│ ├── qiskit_nature.rst
│ ├── qiskit_nature.second_q.algorithms.initial_points.rst
│ ├── qiskit_nature.second_q.algorithms.rst
│ ├── qiskit_nature.second_q.circuit.library.ansatzes.utils.rst
│ ├── qiskit_nature.second_q.circuit.library.rst
│ ├── qiskit_nature.second_q.circuit.rst
│ ├── qiskit_nature.second_q.drivers.gaussiand.rst
│ ├── qiskit_nature.second_q.drivers.psi4d.rst
│ ├── qiskit_nature.second_q.drivers.pyscfd.rst
│ ├── qiskit_nature.second_q.drivers.rst
│ ├── qiskit_nature.second_q.formats.fcidump.rst
│ ├── qiskit_nature.second_q.formats.qcschema.rst
│ ├── qiskit_nature.second_q.formats.rst
│ ├── qiskit_nature.second_q.formats.watson.rst
│ ├── qiskit_nature.second_q.hamiltonians.lattices.rst
│ ├── qiskit_nature.second_q.hamiltonians.rst
│ ├── qiskit_nature.second_q.mappers.rst
│ ├── qiskit_nature.second_q.operators.commutators.rst
│ ├── qiskit_nature.second_q.operators.rst
│ ├── qiskit_nature.second_q.operators.symmetric_two_body.rst
│ ├── qiskit_nature.second_q.operators.tensor_ordering.rst
│ ├── qiskit_nature.second_q.problems.rst
│ ├── qiskit_nature.second_q.properties.rst
│ ├── qiskit_nature.second_q.properties.s_operators.rst
│ ├── qiskit_nature.second_q.rst
│ ├── qiskit_nature.second_q.transformers.rst
│ ├── qiskit_nature.settings.rst
│ ├── qiskit_nature.testing.rst
│ └── qiskit_nature.utils.rst
├── conf.py
├── getting_started.rst
├── howtos
│ ├── adapt_vqe.rst
│ ├── index.rst
│ ├── numpy_eigensolver.rst
│ ├── numpy_minimum_eigensolver.rst
│ ├── vqe_ucc.rst
│ └── vqe_uvcc.rst
├── images
│ ├── logo.png
│ └── overview.png
├── index.rst
├── lowercase_filter.py
├── migration
│ ├── 0.5_a_intro.rst
│ ├── 0.5_b_solving_problems.rst
│ ├── 0.5_c_electronic_structure.rst
│ ├── 0.5_d_vibrational_structure.rst
│ ├── 0.5_e_lattice_models.rst
│ ├── 0.5_f_protein_folding.rst
│ ├── 0.6_a_intro.rst
│ ├── 0.6_b_mes_factory.rst
│ ├── 0.6_c_qubit_converter.rst
│ ├── aux_files
│ │ ├── CO2_freq_B3LYP_631g.log
│ │ ├── h2.fcidump
│ │ └── qiskit_nature_0.5_overview.png
│ └── index.rst
├── release_notes.rst
└── tutorials
│ ├── 01_electronic_structure.ipynb
│ ├── 02_vibrational_structure.ipynb
│ ├── 03_ground_state_solvers.ipynb
│ ├── 04_excited_states_solvers.ipynb
│ ├── 05_problem_transformers.ipynb
│ ├── 06_qubit_mappers.ipynb
│ ├── 08_qcschema.ipynb
│ ├── 09_properties.ipynb
│ ├── 10_lattice_models.ipynb
│ ├── 11_quadratic_hamiltonian_and_slater_determinants.ipynb
│ ├── 12_deuteron_binding_energy.ipynb
│ ├── aux_files
│ ├── CO2_freq_B3LYP_631g.log
│ ├── H2_es.png
│ ├── H2_gs.png
│ ├── jw_mapping.png
│ ├── lattice_protein.png
│ └── vqe.png
│ ├── index.rst
│ └── tutorial_magics.py
├── mypy.ini
├── pyproject.toml
├── qiskit_nature
├── VERSION.txt
├── __init__.py
├── constants.py
├── exceptions.py
├── logging.py
├── optionals.py
├── py.typed
├── second_q
│ ├── __init__.py
│ ├── algorithms
│ │ ├── __init__.py
│ │ ├── excited_states_solvers
│ │ │ ├── __init__.py
│ │ │ ├── excited_states_eigensolver.py
│ │ │ ├── excited_states_solver.py
│ │ │ ├── qeom.py
│ │ │ ├── qeom_electronic_ops_builder.py
│ │ │ └── qeom_vibrational_ops_builder.py
│ │ ├── ground_state_solvers
│ │ │ ├── __init__.py
│ │ │ ├── ground_state_eigensolver.py
│ │ │ └── ground_state_solver.py
│ │ └── initial_points
│ │ │ ├── __init__.py
│ │ │ ├── hf_initial_point.py
│ │ │ ├── initial_point.py
│ │ │ ├── mp2_initial_point.py
│ │ │ └── vscf_initial_point.py
│ ├── circuit
│ │ ├── __init__.py
│ │ └── library
│ │ │ ├── __init__.py
│ │ │ ├── ansatzes
│ │ │ ├── __init__.py
│ │ │ ├── chc.py
│ │ │ ├── puccd.py
│ │ │ ├── puccsd.py
│ │ │ ├── succd.py
│ │ │ ├── ucc.py
│ │ │ ├── uccsd.py
│ │ │ ├── utils
│ │ │ │ ├── __init__.py
│ │ │ │ ├── fermionic_excitation_generator.py
│ │ │ │ └── vibration_excitation_generator.py
│ │ │ ├── uvcc.py
│ │ │ └── uvccsd.py
│ │ │ ├── bogoliubov_transform.py
│ │ │ └── initial_states
│ │ │ ├── __init__.py
│ │ │ ├── fermionic_gaussian_state.py
│ │ │ ├── hartree_fock.py
│ │ │ ├── slater_determinant.py
│ │ │ ├── utils
│ │ │ ├── __init__.py
│ │ │ └── givens_rotations.py
│ │ │ └── vscf.py
│ ├── drivers
│ │ ├── __init__.py
│ │ ├── base_driver.py
│ │ ├── electronic_structure_driver.py
│ │ ├── gaussiand
│ │ │ ├── __init__.py
│ │ │ ├── gauopen
│ │ │ │ ├── LICENSE.txt
│ │ │ │ ├── QCMatEl.py
│ │ │ │ ├── QCOpMat.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── qcmatrixio.F
│ │ │ │ ├── qcmatrixio.cp310-win_amd64.pyd
│ │ │ │ ├── qcmatrixio.cp311-win_amd64.pyd
│ │ │ │ ├── qcmatrixio.cp37-win_amd64.pyd
│ │ │ │ ├── qcmatrixio.cp38-win_amd64.pyd
│ │ │ │ ├── qcmatrixio.cp39-win_amd64.pyd
│ │ │ │ ├── qcmatrixio.cpython-310-darwin.so
│ │ │ │ ├── qcmatrixio.cpython-310-x86_64-linux-gnu.so
│ │ │ │ ├── qcmatrixio.cpython-311-darwin.so
│ │ │ │ ├── qcmatrixio.cpython-311-x86_64-linux-gnu.so
│ │ │ │ ├── qcmatrixio.cpython-37m-darwin.so
│ │ │ │ ├── qcmatrixio.cpython-37m-x86_64-linux-gnu.so
│ │ │ │ ├── qcmatrixio.cpython-38-darwin.so
│ │ │ │ ├── qcmatrixio.cpython-38-x86_64-linux-gnu.so
│ │ │ │ ├── qcmatrixio.cpython-39-darwin.so
│ │ │ │ └── qcmatrixio.cpython-39-x86_64-linux-gnu.so
│ │ │ ├── gaussian_forces_driver.py
│ │ │ ├── gaussian_log_driver.py
│ │ │ ├── gaussian_log_result.py
│ │ │ ├── gaussian_utils.py
│ │ │ └── gaussiandriver.py
│ │ ├── psi4d
│ │ │ ├── __init__.py
│ │ │ ├── _template.txt
│ │ │ └── psi4driver.py
│ │ ├── pyscfd
│ │ │ ├── __init__.py
│ │ │ └── pyscfdriver.py
│ │ └── vibrational_structure_driver.py
│ ├── formats
│ │ ├── __init__.py
│ │ ├── fcidump
│ │ │ ├── __init__.py
│ │ │ ├── dumper.py
│ │ │ ├── fcidump.py
│ │ │ └── parser.py
│ │ ├── fcidump_translator.py
│ │ ├── molecule_info.py
│ │ ├── qcschema
│ │ │ ├── __init__.py
│ │ │ ├── qc_base.py
│ │ │ ├── qc_basis_set.py
│ │ │ ├── qc_error.py
│ │ │ ├── qc_model.py
│ │ │ ├── qc_properties.py
│ │ │ ├── qc_provenance.py
│ │ │ ├── qc_schema.py
│ │ │ ├── qc_schema_input.py
│ │ │ ├── qc_topology.py
│ │ │ └── qc_wavefunction.py
│ │ ├── qcschema_translator.py
│ │ ├── watson
│ │ │ ├── __init__.py
│ │ │ └── watson_hamiltonian.py
│ │ └── watson_translator.py
│ ├── hamiltonians
│ │ ├── __init__.py
│ │ ├── electronic_energy.py
│ │ ├── fermi_hubbard_model.py
│ │ ├── hamiltonian.py
│ │ ├── heisenberg_model.py
│ │ ├── ising_model.py
│ │ ├── lattice_model.py
│ │ ├── lattices
│ │ │ ├── __init__.py
│ │ │ ├── boundary_condition.py
│ │ │ ├── hexagonal_lattice.py
│ │ │ ├── hyper_cubic_lattice.py
│ │ │ ├── kagome_lattice.py
│ │ │ ├── lattice.py
│ │ │ ├── line_lattice.py
│ │ │ ├── square_lattice.py
│ │ │ └── triangular_lattice.py
│ │ ├── quadratic_hamiltonian.py
│ │ └── vibrational_energy.py
│ ├── mappers
│ │ ├── __init__.py
│ │ ├── bksf.py
│ │ ├── bosonic_linear_mapper.py
│ │ ├── bosonic_logarithmic_mapper.py
│ │ ├── bosonic_mapper.py
│ │ ├── bravyi_kitaev_mapper.py
│ │ ├── direct_mapper.py
│ │ ├── fermionic_mapper.py
│ │ ├── interleaved_qubit_mapper.py
│ │ ├── jordan_wigner_mapper.py
│ │ ├── linear_mapper.py
│ │ ├── logarithmic_mapper.py
│ │ ├── majorana_mapper.py
│ │ ├── mixed_mapper.py
│ │ ├── mode_based_mapper.py
│ │ ├── parity_mapper.py
│ │ ├── qubit_mapper.py
│ │ ├── spin_mapper.py
│ │ ├── tapered_qubit_mapper.py
│ │ ├── ternary_tree_mapper.py
│ │ └── vibrational_mapper.py
│ ├── operators
│ │ ├── __init__.py
│ │ ├── _bits_container.py
│ │ ├── bosonic_op.py
│ │ ├── commutators.py
│ │ ├── electronic_integrals.py
│ │ ├── fermionic_op.py
│ │ ├── majorana_op.py
│ │ ├── mixed_op.py
│ │ ├── polynomial_tensor.py
│ │ ├── sparse_label_op.py
│ │ ├── spin_op.py
│ │ ├── symmetric_two_body.py
│ │ ├── tensor.py
│ │ ├── tensor_ordering.py
│ │ ├── vibrational_integrals.py
│ │ └── vibrational_op.py
│ ├── problems
│ │ ├── __init__.py
│ │ ├── base_problem.py
│ │ ├── eigenstate_result.py
│ │ ├── electronic_basis.py
│ │ ├── electronic_properties_container.py
│ │ ├── electronic_structure_problem.py
│ │ ├── electronic_structure_result.py
│ │ ├── harmonic_basis.py
│ │ ├── lattice_model_problem.py
│ │ ├── lattice_model_result.py
│ │ ├── lattice_properties_container.py
│ │ ├── properties_container.py
│ │ ├── vibrational_basis.py
│ │ ├── vibrational_properties_container.py
│ │ ├── vibrational_structure_problem.py
│ │ └── vibrational_structure_result.py
│ ├── properties
│ │ ├── __init__.py
│ │ ├── angular_momentum.py
│ │ ├── dipole_moment.py
│ │ ├── electronic_density.py
│ │ ├── magnetization.py
│ │ ├── occupied_modals.py
│ │ ├── particle_number.py
│ │ ├── protocols.py
│ │ └── s_operators.py
│ └── transformers
│ │ ├── __init__.py
│ │ ├── active_space_transformer.py
│ │ ├── base_transformer.py
│ │ ├── basis_transformer.py
│ │ └── freeze_core_transformer.py
├── settings.py
├── testing
│ ├── __init__.py
│ └── random.py
├── units.py
├── utils
│ ├── __init__.py
│ ├── linalg.py
│ └── opt_einsum.py
└── version.py
├── releasenotes
├── config.yaml
└── notes
│ ├── 0.2
│ ├── add-bksf-mapper-7826652bfa4403a6.yaml
│ ├── add-fermionicop-label-mode-a1faa97811dac9b4.yaml
│ ├── add-hermiticity-checks-secondquantizedops-c9b28597bb9ec6a0.yaml
│ ├── bugfix-fermionicop-init-4005d72e38ba67f4.yaml
│ ├── bugfix-totaldipole-0e2271edcdd45cb0.yaml
│ ├── consistent-qiskit-nature-branding-470b2ca1d55ec7b6.yaml
│ ├── deprecate-evolved-operator-ansatz-9ddf9002667cc914.yaml
│ ├── fermionicop-normal-order-cd550917dff142fc.yaml
│ ├── fix-active-space-error-formatting-79e4126b65004feb.yaml
│ ├── fix-adapt-vqe-c9df0c06ea352b91.yaml
│ ├── fix-incompatibility-of-freeze-core-and-z2symmetry-1b5caa71986abaee.yaml
│ ├── molecule-driver-762847a396e6bc9e.yaml
│ ├── port-star-algebra-1727d74437c48390.yaml
│ ├── property-framework-a3a3239ab9ad52df.yaml
│ ├── relocate-drivers-fac59a504b5bc986.yaml
│ ├── runtime-vqe-program-4a860e71ba53a780.yaml
│ ├── skip-two-qubit-reduction-when-too-small-50ab22e9155db918.yaml
│ ├── vqeprogram-aux-operators-9db380d8e20b1f1d.yaml
│ └── vqeprogram-optimizers-cd23307c10fcd15b.yaml
│ ├── 0.3
│ ├── add-getter-and-setter-degrees_of_freedom-5f150869ea94e54a.yaml
│ ├── add-ising-model-3f6e53c0281bf4a5.yaml
│ ├── add-lattice-module-7b51630da1cc5d1b.yaml
│ ├── expose-callback-on-vqe-factories-951fadf826d6be7a.yaml
│ ├── fermionic-op-to-matrix-4abd3f1b53f6e6d5.yaml
│ ├── fix-active-space-transformer-non-singlet-manual-selection-d022bdbfaccc7e65.yaml
│ ├── fix-electronic-energy-orbital-energies-603034a6b424818a.yaml
│ ├── fix-electronic-structure-result-printing-3564bc515f252a9a.yaml
│ ├── fix-mapper-bug-8eba9d219595b8e1.yaml
│ ├── fix_hfstate_auto_symmetry-6038fecf7ef2c822.yaml
│ ├── gaussian-py39-1c519a1bb2f370d3.yaml
│ ├── generalized-fermionic-excitations-1d345d179e097896.yaml
│ ├── legacy-molecule-data-transformed-d6ca735fe8332739.yaml
│ ├── print-vibrational-excited-state-energies-0ea51457b3a4a69f.yaml
│ ├── qeom_fix-4341f74549f22891.yaml
│ ├── remove_deprecated_evopansatz-36c3c872419a4329.yaml
│ ├── rename-runtime-program-9afac6a99a6de213.yaml
│ ├── sparse-input-to-bksf-fd803ea1e9d05d2d.yaml
│ ├── ucc-check-excitations-4fb34977b9b0c1d1.yaml
│ └── update-runtime-tutorial-20378bfd85b719df.yaml
│ ├── 0.4
│ ├── BOPERSampler-supports-MinimumEigensolverFactories-d920a7870d7e265d.yaml
│ ├── add-hf-initial-point-ac29baf3091fa5b1.yaml
│ ├── add-logging-171aceb37c21a3d5.yaml
│ ├── add-python310-support-6ef188b2e1572cc8.yaml
│ ├── added_support-of-bohr-unit-4b27ef4b89f7ee32.yaml
│ ├── bksf-fix-corner-cases-7f66d695fc316e9a.yaml
│ ├── bksf-fix-op-compose-bc8161a50bf9acaa.yaml
│ ├── bogoliubov-transform-885eb6442172c76e.yaml
│ ├── dict_based_aux_ops_in_vqeclient-cef82ff240b51650.yaml
│ ├── drop-python3.6-support-ea12d78ea8616c74.yaml
│ ├── einsum-optimization-27ae7457599e578e.yaml
│ ├── fermionicop-iter-a60ae0ed7e3cff1e.yaml
│ ├── fermionicop-sparse-format-3aa7c9d52b9396e4.yaml
│ ├── fix-as-trafo-grouped-property-iteration-bca2096817b1e497.yaml
│ ├── fix-freeze-core-372ac9f9d3ffd4c0.yaml
│ ├── fix-inference-of-register-length-cf23f13a477e9e57.yaml
│ ├── fix-molecule-coordinate-units-61f109372dcf7842.yaml
│ ├── fix-non-singlet-occupation-computation-f2ff44b144b53732.yaml
│ ├── fix-transpile-uccsd-db7f2557e6155017.yaml
│ ├── fix_groundenergy-f973527ae6296c59.yaml
│ ├── fix_uccsd_op_build-6b0bc1de57f3e423.yaml
│ ├── gradient-based-adapt-vqe-aa4e89f44c5aa69e.yaml
│ ├── hdf5-driver-bafbbd8e70ee15a6.yaml
│ ├── hdf5-integration-b08c31426d1fdf9e.yaml
│ ├── initialize-ferop-with-tuple-as-label-0dc3f1dbd754ca29.yaml
│ ├── lattice-edge-typecheck-3f5b4896fe26c8dc.yaml
│ ├── lattice-from-networkx-20c7c8119af77f36.yaml
│ ├── lattice_model_problem-3925bfbd2267cd4c.yaml
│ ├── logarithmic_mapper-f655fc66d319ba08.yaml
│ ├── migrate-mp2-info-b1a3ee7320c46053.yaml
│ ├── performance-two-body-second-q-op-08f906951005ebc1.yaml
│ ├── protein-folding-result-b344ac3c7f48e3ca.yaml
│ ├── quad-ham-7c98cc11f700bdc5.yaml
│ ├── simplify-01d1b75c00a7eac9.yaml
│ ├── slater-53415163fff84313.yaml
│ ├── support_excitedstatessolver_bopes-2bbb5a282b1ff582.yaml
│ ├── uvcc_op_creation-bac88e1f58c781ae.yaml
│ ├── vibrational-truncation-order-92ebbd78cc2c29fa.yaml
│ ├── vqe-factory-improvements-02f411513f11907c.yaml
│ └── vqeclient-extends-variationalalg-eb5b3f951405fd16.yaml
│ ├── 0.5
│ ├── 0.5-prelude-a1d20e9b76893ece.yaml
│ ├── added-heisenberg-model-218b7ca8386e208a.yaml
│ ├── approx-eq-15521c2b1ece996b.yaml
│ ├── caching-qubit-mapper-ddfc5fae0bda18be.yaml
│ ├── deprecate-legacy-code-fe9db8a009b6f5d2.yaml
│ ├── electronic-density-c1a95826c0a51ed0.yaml
│ ├── feat-properties-container-a89f4ada04ab5daa.yaml
│ ├── feat-succd-mirror-kwarg-5b9f14b11d8992b9.yaml
│ ├── feat-support-qcschema-1b120c18da79d4e2.yaml
│ ├── feat-vscf-and-hartree-as-blueprintcircuits-15167723fdd504d5.yaml
│ ├── fermionic-sparse-label-op-144651db630a8aa1.yaml
│ ├── fix-existing-initial-point-with-reps-5ca0fd2defe00539.yaml
│ ├── fix-gaussian-forces-driver-from-molecule-xcf-6702ec346d1d94da.yaml
│ ├── fix-generalized-non-spin-preserving-excitations-72745abc12e06c92.yaml
│ ├── fix-initial-point-with-reps-6157ede7a3b9924a.yaml
│ ├── fix-isinstance-integer-checks-50f7614393e68e87.yaml
│ ├── fix-mp2-energy-correction-8a86c3f073d821d7.yaml
│ ├── fix-multi-line-data-support-in-gaussian-log-parsing-50e964d30d8fef00.yaml
│ ├── fix-simplify-zero-fermionicop-f2f68e6f19613468.yaml
│ ├── fix-vqe-client-aux-operator-types-ef721cdc127e2fff.yaml
│ ├── fix-vqe-client-aux-ops-c97dd2c150dc02a8.yaml
│ ├── is-hermitian-33d1000779fba472.yaml
│ ├── move-qeom-hopping-op-builders-23a76b15094a4dce.yaml
│ ├── op-norm-3f4d73df98bc03fc.yaml
│ ├── remove-vqeprogram-02db084331f901f0.yaml
│ ├── retworkx-rustworkx-7836a84db7669814.yaml
│ └── two-body-symmetry-conversion-db45518ff5fb41bd.yaml
│ ├── 0.6
│ ├── 0.6-prelude-fbf9f7e6b1b910fa.yaml
│ ├── add-get-tapered-mapper-for-problems-33292452930141d1.yaml
│ ├── add-python311-support-3a939c4697ecd896.yaml
│ ├── deprecate-eigensolver-factories-91808a78261e7f6b.yaml
│ ├── deprecate-fermionic-op-to-matrix-74b182129fbb0171.yaml
│ ├── deprecate-qubit-converter-313ee07a36aa0c71.yaml
│ ├── deprecate-vqe-client-8d355440b6dcbdb4.yaml
│ ├── feat-electronic-denisty-initializations-d1bd5131c5776418.yaml
│ ├── feat-interleaved-qubit-mapper-1f04e5b12383386e.yaml
│ ├── feat-standalone-active-space-9033186e6849f46d.yaml
│ ├── feat-symmetric-electronic-integrals-7791b8fba0ebd75f.yaml
│ ├── feat-tensor-class-2ad38ba7246ccbd5.yaml
│ ├── fix-bind-params-a2851b14e3b8e247.yaml
│ ├── fix-commutator-simplification-tolerance-09c72ce1adc0bbf0.yaml
│ ├── fix-debye-dipole-0154e964da22910d.yaml
│ ├── fix-generate-fermionic-excitations-309b771ceb14761f.yaml
│ ├── fix-qcschema-reading-mixed-spin-eri-8baa797ec14f9dd5.yaml
│ ├── fix-sparse-label-op-is-zero-ebeca4d6871c9642.yaml
│ ├── fix-sparse-label-op-numpy-type-support-759a10226357157c.yaml
│ ├── fix-spin-op-index-order-024e76d21b08bb9a.yaml
│ ├── fix-vibrational-op-commutation-5cbda6833c0d5232.yaml
│ ├── fix-vqe-runtime-client-tutorial-f1e6f91372f89ca5.yaml
│ ├── gaussian-wheel-5f608294891f76ce.yaml
│ ├── givens-fix-a12cb547cf5a1be4.yaml
│ ├── implements-two-qubit-reduction-in-paritymapper-f88ef199f0a954b6.yaml
│ ├── numpy-based-vibrational-integrals-7343c0fa56e2e5c5.yaml
│ ├── opt_einsum-f267e198d895f801.yaml
│ ├── paulisumop-replace-d1ae54d1854b301b.yaml
│ ├── pending-deprecate-mqwv-matrix-setter-1cd9e2dfb68d1a85.yaml
│ ├── qubit-mapper-improvements-4fad546226cdc035.yaml
│ ├── refactors-and-upgrades-qeom-bd14d85c94e912d0.yaml
│ ├── result-formatting-precision-d62a868cbd801a58.yaml
│ ├── testing-module-d0f545c685574af2.yaml
│ ├── update-api-for-qubitmapper-qubitconverter-d237a7b596d50207.yaml
│ └── vqeclient-v2-compat-5fd7a2b58cac8651.yaml
│ ├── 0.7
│ ├── 0.7-prelude-169d294985170fd5.yaml
│ ├── add-hexagonal-lattice-a981f1b5c832a154.yaml
│ ├── add-kagome-lattice-ba5a4867f4eab15d.yaml
│ ├── better-angular-momentum-9de340ef91d1024a.yaml
│ ├── bosonic-operator-and-mapper-45bfde873f092681.yaml
│ ├── drop_python_3_7-35d42f30e19e7683.yaml
│ ├── faster-symmetry-unfolding-46d775eb5b2a4bf7.yaml
│ ├── feat-polytensor-apply-multi-a3deea9586e6451a.yaml
│ ├── feat-tensor-splitting-and-stacking-610c2de4f3353a1d.yaml
│ ├── fix-active-space-integer-rounding-753ae77146610d9d.yaml
│ ├── fix-electronic-structure-result-printing-6e0b092097386c8f.yaml
│ ├── fix-excited-states-tutorial-7eaf143d365b76c6.yaml
│ ├── fix-fock-5bfbf630809a0570.yaml
│ ├── fix-freeze-core-transformer-with-charge-db3bd62005e9555c.yaml
│ ├── fix-from-polynomial-tensor-constant-9df7f63be4a4c819.yaml
│ ├── fix-hartree-fock-reference-energy-6c43c5fd68d83505.yaml
│ ├── fix-interleaved-qubit-mapper-2877a7d00921911e.yaml
│ ├── fix-spin-op-to-matrix-e84594248fc49fd7.yaml
│ ├── fix-tensor-copying-a79c9cd626bd5563.yaml
│ ├── improve-register-length-handling-cb55f644da136828.yaml
│ ├── low-rank-linalg-86da86096d6122d8.yaml
│ ├── manual-unrestricted-spin-active-space-2462e3a9b8a10a10.yaml
│ ├── puccsd-ansatz-7c97be6dca32a873.yaml
│ ├── qubit-mapper-performance-ef339b83f951e5a3.yaml
│ ├── sparse-3_11-1538988547ff6dd6.yaml
│ ├── support-pauli-sum-op-setting-in-ucc-43e33016b268cf19.yaml
│ └── ucc_imaginary-8d7d9c3322899a34.yaml
│ ├── add-majoranaop-1cbf9d4a1d4c264e.yaml
│ ├── add-ternary-tree-mapper-dad9b02ae4af54d2.yaml
│ ├── bosonic-logarithmic-mapper-4b1f24c4ca16cf8b.yaml
│ ├── drop_python_3_8-fd6fe0e7f9fbff49.yaml
│ ├── fix-UCC-and-fully-occupied-MOs-c8fdf252a0607395.yaml
│ ├── fix-angular-momentum-2-cebabde075b61a4e.yaml
│ ├── fix-angular-momentum-73eca0a5afb70679.yaml
│ ├── fix-commutator-methods-fdae69426a05222a.yaml
│ ├── improve-mappers-b55cb0ca5fd656e4.yaml
│ ├── introduce-mixedop-and-mixed-mapper-46f0ef30314c71c0.yaml
│ └── py_3_12_support-ff91e3a300421b3d.yaml
├── requirements-dev.txt
├── requirements.txt
├── setup.py
├── test
├── __init__.py
├── decorators.py
├── nature_test_case.py
├── second_q
│ ├── __init__.py
│ ├── algorithms
│ │ ├── __init__.py
│ │ ├── excited_state_solvers
│ │ │ ├── __init__.py
│ │ │ ├── resources
│ │ │ │ ├── __init__.py
│ │ │ │ ├── expected_qeom_ops.py
│ │ │ │ └── expected_transition_amplitudes.py
│ │ │ ├── test_bosonic_esc_calculation.py
│ │ │ ├── test_excited_states_solvers.py
│ │ │ ├── test_excited_states_solvers_auxiliaries.py
│ │ │ ├── test_qeom_electronic_ops.py
│ │ │ └── test_qeom_vibrational_ops.py
│ │ ├── ground_state_solvers
│ │ │ ├── __init__.py
│ │ │ ├── test_advanced_ucc_variants.py
│ │ │ ├── test_groundstate_eigensolver.py
│ │ │ └── test_swaprz.py
│ │ └── initial_points
│ │ │ ├── __init__.py
│ │ │ ├── test_hf_initial_point.py
│ │ │ ├── test_initial_point.py
│ │ │ ├── test_mp2_initial_point.py
│ │ │ └── test_vscf_initial_point.py
│ ├── circuit
│ │ ├── __init__.py
│ │ └── library
│ │ │ ├── __init__.py
│ │ │ ├── ansatzes
│ │ │ ├── __init__.py
│ │ │ ├── test_chc.py
│ │ │ ├── test_puccd.py
│ │ │ ├── test_puccsd.py
│ │ │ ├── test_succd.py
│ │ │ ├── test_ucc.py
│ │ │ ├── test_uccsd.py
│ │ │ ├── test_uvcc.py
│ │ │ └── utils
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_fermionic_excitation_generator.py
│ │ │ │ ├── test_vibration_excitation_generator.py
│ │ │ │ └── vibrational_op_label_creator.py
│ │ │ ├── initial_states
│ │ │ ├── __init__.py
│ │ │ ├── test_fermionic_gaussian_state.py
│ │ │ ├── test_hartree_fock.py
│ │ │ ├── test_slater_determinant.py
│ │ │ └── test_vscf.py
│ │ │ └── test_bogoliubov_transform.py
│ ├── drivers
│ │ ├── __init__.py
│ │ ├── gaussiand
│ │ │ ├── __init__.py
│ │ │ ├── test_driver_gaussian.py
│ │ │ ├── test_driver_gaussian_extra.py
│ │ │ ├── test_driver_gaussian_forces.py
│ │ │ ├── test_driver_gaussian_from_mat.mat
│ │ │ ├── test_driver_gaussian_from_mat.py
│ │ │ ├── test_driver_gaussian_log.py
│ │ │ ├── test_driver_gaussian_log_A03.txt
│ │ │ ├── test_driver_gaussian_log_C01.txt
│ │ │ ├── test_driver_gaussian_log_polyyne_2.txt
│ │ │ ├── test_driver_gaussian_log_vibrational_energy.hdf5
│ │ │ └── test_driver_methods_gaussian.py
│ │ ├── psi4d
│ │ │ ├── __init__.py
│ │ │ ├── test_driver_methods_psi4.py
│ │ │ ├── test_driver_psi4.py
│ │ │ └── test_driver_psi4_extra.py
│ │ ├── pyscfd
│ │ │ ├── __init__.py
│ │ │ ├── test_driver_methods_pyscf.py
│ │ │ └── test_driver_pyscf.py
│ │ ├── test_driver.py
│ │ └── test_driver_methods_gsc.py
│ ├── formats
│ │ ├── __init__.py
│ │ ├── fcidump
│ │ │ ├── __init__.py
│ │ │ ├── test_fcidump.py
│ │ │ ├── test_fcidump_dumper.py
│ │ │ ├── test_fcidump_h2.fcidump
│ │ │ ├── test_fcidump_lih.fcidump
│ │ │ ├── test_fcidump_lih.npz
│ │ │ ├── test_fcidump_oh.fcidump
│ │ │ ├── test_fcidump_oh.npz
│ │ │ └── test_methods_fcidump.py
│ │ ├── qcschema
│ │ │ ├── __init__.py
│ │ │ ├── he2_energy_VV10_input.json
│ │ │ ├── he2_energy_VV10_input.py
│ │ │ ├── he2_energy_VV10_output.json
│ │ │ ├── he2_energy_VV10_output.py
│ │ │ ├── legacy_electronic_structure_driver_result.hdf5
│ │ │ ├── legacy_electronic_structure_driver_result.json
│ │ │ ├── water_output.json
│ │ │ ├── water_output.py
│ │ │ ├── water_output_v3.json
│ │ │ └── water_output_v3.py
│ │ └── test_qcschema.py
│ ├── hamiltonians
│ │ ├── __init__.py
│ │ ├── lattices
│ │ │ ├── __init__.py
│ │ │ ├── test_hexagonal_lattice.py
│ │ │ ├── test_hyper_cubic_lattice.py
│ │ │ ├── test_kagome_lattice.py
│ │ │ ├── test_lattice.py
│ │ │ ├── test_line_lattice.py
│ │ │ ├── test_square_lattice.py
│ │ │ └── test_triangular_lattice.py
│ │ ├── resources
│ │ │ └── electronic_energy_op.json
│ │ ├── test_electronic_energy.py
│ │ ├── test_fermi_hubbard_model.py
│ │ ├── test_heisenberg_model.py
│ │ ├── test_ising_model.py
│ │ ├── test_quadratic_hamiltonian.py
│ │ └── test_vibrational_energy.py
│ ├── mappers
│ │ ├── __init__.py
│ │ ├── resources
│ │ │ ├── __init__.py
│ │ │ ├── bksf_lih.py
│ │ │ └── reference_direct_mapper.py
│ │ ├── test_bksf_mapper.py
│ │ ├── test_bosonic_linear_mapper.py
│ │ ├── test_bosonic_logarithmic_mapper.py
│ │ ├── test_bravyi_kitaev_mapper.py
│ │ ├── test_direct_mapper.py
│ │ ├── test_interleaved_qubit_mapper.py
│ │ ├── test_jordan_wigner_mapper.py
│ │ ├── test_linear_mapper.py
│ │ ├── test_logarithmic_mapper.py
│ │ ├── test_mixed_mapper.py
│ │ ├── test_parity_mapper.py
│ │ ├── test_tapered_qubit_mapper.py
│ │ └── test_ternary_tree_mapper.py
│ ├── operators
│ │ ├── __init__.py
│ │ ├── tensor_test_cases.py
│ │ ├── test_bosonic_op.py
│ │ ├── test_commutators.py
│ │ ├── test_electronic_integrals.py
│ │ ├── test_fermionic_op.py
│ │ ├── test_majorana_op.py
│ │ ├── test_mixed_op.py
│ │ ├── test_polynomial_tensor.py
│ │ ├── test_sparse_label_op.py
│ │ ├── test_spin_op.py
│ │ ├── test_symmetric_two_body.py
│ │ ├── test_tensor.py
│ │ ├── test_tensor_ordering.py
│ │ └── test_vibrational_op.py
│ ├── problems
│ │ ├── __init__.py
│ │ ├── resources
│ │ │ ├── H2_631g_ferm_op.json
│ │ │ ├── H2_631g_ferm_op_active_space.json
│ │ │ ├── __init__.py
│ │ │ └── expected_ops.py
│ │ ├── test_eigenstate_result.py
│ │ ├── test_electronic_properties_container.py
│ │ ├── test_electronic_structure_problem.py
│ │ ├── test_electronic_structure_result.py
│ │ ├── test_lattice_model_problem.py
│ │ ├── test_lattice_properties_container.py
│ │ ├── test_properties_container.py
│ │ ├── test_vibrational_properties_container.py
│ │ └── test_vibrational_structure_problem.py
│ ├── properties
│ │ ├── __init__.py
│ │ ├── property_test.py
│ │ ├── resources
│ │ │ ├── angular_momentum_op.json
│ │ │ └── vibrational_energy_op.json
│ │ ├── test_angular_momentum.py
│ │ ├── test_dipole_moment.py
│ │ ├── test_electronic_density.py
│ │ ├── test_magnetization.py
│ │ ├── test_occupied_modals.py
│ │ ├── test_particle_number.py
│ │ └── test_s_operators.py
│ ├── transformers
│ │ ├── __init__.py
│ │ ├── resources
│ │ │ ├── BeH_sto3g_reduced.json
│ │ │ ├── LiH_sto3g_reduced.json
│ │ │ └── __init__.py
│ │ ├── test_active_space_transformer.py
│ │ ├── test_basis_transformer.py
│ │ └── test_freeze_core_transformer.py
│ └── utils.py
├── test_end2end_with_vqe.py
├── test_logging.py
├── testing
│ ├── __init__.py
│ └── test_random.py
└── utils
│ ├── __init__.py
│ └── test_linalg.py
├── tools
├── check_copyright.py
├── extract_deprecation.py
├── find_stray_release_notes.py
├── generate_spell_dict.py
├── ignore_untagged_notes.sh
└── verify_headers.py
└── tox.ini
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2017, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | # EditorConfig sets project-wide editor defaults: https://EditorConfig.org
14 |
15 | # top-most EditorConfig file, stop looking higher in the tree
16 | root = true
17 |
18 | # Default settings can be overidden by editorconfig file in a subdir
19 | # or by a specific glob later in this file
20 | [*]
21 | end_of_line = lf
22 | insert_final_newline = true
23 | charset = utf-8
24 | indent_style = space
25 | trim_trailing_whitespace = true
26 |
27 | # Python
28 | [*.py]
29 | indent_size = 4
30 |
31 | # Javascript
32 | [*.{js,json}]
33 | indent_style = space
34 | indent_size = 2
35 |
36 | ## Windows files
37 | # [*.bat]
38 | # end_of_line = crlf
39 |
40 | # Makefile
41 | [Makefile]
42 | indent_style = tab
43 |
44 | # Markdown
45 | [*.md]
46 | # trailing whitespace is used for
in md (yuck)
47 | trim_trailing_whitespace = false
48 |
49 | # YAML
50 | [*.{yaml,yml}]
51 | indent_size = 2
52 |
--------------------------------------------------------------------------------
/.git-blame-ignore-revs:
--------------------------------------------------------------------------------
1 | 8a88efcccd35474d8affaef53cf16d799f9ef65b
2 | c3a5d683f90e92a8b37acac640bddbc5e3a54b8c
3 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # This file defines the set of people responsible for different sections of the
2 | # Qiskit code.
3 | #
4 | # Being listed as a code owner on a section here means that user is empowered
5 | # to approve and merge pull requests for that section of code. It also comes
6 | # with an expected responsibility to review and maintain those subsections of
7 | # the repository.
8 | #
9 | # A PR can be merged when approved by at least one codeowner. For PRs that touch
10 | # more than one section with non-overlapping codeowners more than one codeowner
11 | # may be required to approve a PR.
12 | #
13 | # However, every contributor to Qiskit can (and should!) review open PRs. This
14 | # file is just about outlining responsibility for maintainership and final
15 | # review/merging of PRs in different subsections of the repository.
16 |
17 | # Global rule, unless specialized by a later one
18 | * @woodsp-ibm @mrossinek @robertodr @matteoacrossi @fpietra @Panadestein @ludmilaasb
19 |
20 | # Qiskit Nature modules
21 | mappers/ @woodsp-ibm @mrossinek @robertodr @matteoacrossi @ftroisi @fpietra @Panadestein @ludmilaasb
22 | operators/ @woodsp-ibm @mrossinek @robertodr @matteoacrossi @ftroisi @fpietra @Panadestein @ludmilaasb
23 |
24 | # Override the release notes directories to have _no_ code owners, so any review
25 | # from somebody with write access is acceptable.
26 | /docs
27 | /releasenotes/notes
28 | /tools
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yaml:
--------------------------------------------------------------------------------
1 | name: 🚀 Feature request
2 | description: Suggest an idea for this project 💡!
3 | labels: ["type: feature request"]
4 |
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: Please make sure to browse the opened and closed issues to make sure that this idea has not previously been discussed.
9 |
10 | - type: textarea
11 | attributes:
12 | label: What should we add?
13 | validations:
14 | required: true
15 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
11 |
12 | ### Summary
13 |
14 |
15 |
16 | ### Details and comments
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.github/actions/install-nature/action.yml:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | name: 'Install Qiskit Nature'
14 | description: 'Installs Qiskit Nature on developer mode'
15 | inputs:
16 | use-conda:
17 | description: 'Use conda'
18 | required: true
19 | runs:
20 | using: "composite"
21 | steps:
22 | - run : |
23 | if [ "${{ inputs.use-conda }}" == "true" ]; then
24 | source "$CONDA/etc/profile.d/conda.sh"
25 | conda activate psi4env
26 | fi
27 | pip install -e .[pyscf,mpl,sparse,opt_einsum]
28 | pip install -U -c constraints.txt -r requirements-dev.txt
29 | # disable a PySCF UserWarning w.r.t. a change in the B3LYP DFT functional
30 | echo "B3LYP_WITH_VWN5 = True" >> ~/.pyscf_conf.py
31 | shell: bash
32 |
--------------------------------------------------------------------------------
/.github/actions/install-psi4/action.yml:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2025.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | name: 'Install PSI4'
14 | description: 'Installs conda PSI4'
15 | inputs:
16 | os:
17 | description: 'OS'
18 | required: true
19 | python-version:
20 | description: 'Python version'
21 | required: true
22 | runs:
23 | using: "composite"
24 | steps:
25 | - run : |
26 | source "$CONDA/etc/profile.d/conda.sh"
27 | conda activate psi4env
28 | echo "installs psi4 stable release"
29 | conda install -y psi4 python=${{ inputs.python-version }} -c conda-forge/label/libint_dev -c conda-forge
30 | shell: bash
31 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Check for updates to GitHub Actions
2 | version: 2
3 | updates:
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 |
--------------------------------------------------------------------------------
/.github/problem_matchers/black.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "black",
5 | "pattern": [
6 | {
7 | "regexp": "^(would reformat\\s(.+))$",
8 | "file": 2,
9 | "message": 1
10 | }
11 | ]
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.github/problem_matchers/copyright.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "copyright",
5 | "pattern": [
6 | {
7 | "regexp": "^Wrong Copyright Year: '(.+)': (.+)$",
8 | "file": 1,
9 | "message": 2
10 | }
11 | ]
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.github/problem_matchers/mypy.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "mypy",
5 | "pattern": [
6 | {
7 | "regexp": "^(.+):(\\d+):\\s(error|warning|note):\\s(.+)\\s+\\[(.+)\\]$",
8 | "file": 1,
9 | "line": 2,
10 | "severity": 3,
11 | "message": 4,
12 | "code": 5
13 | }
14 | ]
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/.github/problem_matchers/pylint.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "pylint-error",
5 | "severity": "error",
6 | "pattern": [
7 | {
8 | "regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$",
9 | "file": 1,
10 | "line": 2,
11 | "column": 3,
12 | "message": 4,
13 | "code": 5
14 | }
15 | ]
16 | },
17 | {
18 | "owner": "pylint-warning",
19 | "severity": "warning",
20 | "pattern": [
21 | {
22 | "regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$",
23 | "file": 1,
24 | "line": 2,
25 | "column": 3,
26 | "message": 4,
27 | "code": 5
28 | }
29 | ]
30 | }
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/.github/problem_matchers/spell.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "pylint-spell",
5 | "severity": "error",
6 | "pattern": [
7 | {
8 | "regexp": "^(.+):\\d+:\\d+:\\s((C\\d{4}):\\s.+)$",
9 | "file": 1,
10 | "message": 2,
11 | "code": 3
12 | }
13 | ]
14 | },
15 | {
16 | "owner": "sphinx-spell",
17 | "severity": "error",
18 | "pattern": [
19 | {
20 | "regexp": "^(.+):\\d+:\\s((Spell check):\\s.+)$",
21 | "file": 1,
22 | "message": 2,
23 | "code": 3
24 | }
25 | ]
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/.github/workflows/deploy-code.yml:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | name: Deploy Code
14 |
15 | on:
16 | push:
17 | tags:
18 | - '*'
19 |
20 | jobs:
21 | code_publish:
22 | runs-on: ubuntu-latest
23 | environment: release
24 | permissions:
25 | id-token: write
26 | strategy:
27 | matrix:
28 | python-version: [3.9]
29 | steps:
30 | - uses: actions/checkout@v4
31 | - uses: actions/setup-python@v5
32 | with:
33 | python-version: ${{ matrix.python-version }}
34 | - name: Install deps
35 | run: pip install -U pip setuptools virtualenv wheel
36 | - name: Build sdist
37 | run: python3 setup.py sdist bdist_wheel
38 | - uses: actions/upload-artifact@v4
39 | with:
40 | path: ./dist/*
41 | - name: Deploy to Pypi
42 | uses: pypa/gh-action-pypi-publish@release/v1
43 |
--------------------------------------------------------------------------------
/.mergify.yml:
--------------------------------------------------------------------------------
1 | queue_rules:
2 | - name: automerge
3 | queue_conditions:
4 | - check-success=Deprecation_Messages_and_Coverage (3.9)
5 | merge_method: squash
6 |
7 | pull_request_rules:
8 | - name: automatic merge on CI success and review
9 | conditions:
10 | - check-success=Deprecation_Messages_and_Coverage (3.9)
11 | - "#approved-reviews-by>=1"
12 | - label=automerge
13 | - label!=on hold
14 | actions:
15 | queue:
16 | name: automerge
17 | - name: backport
18 | conditions:
19 | - label=stable backport potential
20 | actions:
21 | backport:
22 | branches:
23 | - stable/0.7
24 |
--------------------------------------------------------------------------------
/.stestr.conf:
--------------------------------------------------------------------------------
1 | [DEFAULT]
2 | test_path=./test
--------------------------------------------------------------------------------
/CITATION.cff:
--------------------------------------------------------------------------------
1 | cff-version: 1.2.0
2 | message: "If you use this software, please cite it as below."
3 | authors:
4 | - family-names: "The Qiskit Nature developers and contributors"
5 | title: "Qiskit Nature"
6 | version: 0.6.0
7 | doi: 10.5281/zenodo.7828767
8 | date-released: 2023-04-14
9 | url: "https://github.com/qiskit-community/qiskit-nature"
10 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Code of Conduct
4 | All members of this project agree to adhere to the Qiskit Code of Conduct listed at [https://github.com/Qiskit/qiskit/blob/master/CODE_OF_CONDUCT.md](https://github.com/Qiskit/qiskit/blob/master/CODE_OF_CONDUCT.md)
5 |
6 | ----
7 |
8 | License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/),
9 | Copyright Contributors to Qiskit.
10 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include LICENSE.txt
2 | include requirements.txt
3 | include qiskit_nature/py.typed
4 | recursive-include qiskit_nature *.txt
5 | graft qiskit_nature/drivers/second_quantization/gaussiand/gauopen
6 | graft qiskit_nature/second_q/drivers/gaussiand/gauopen
7 | graft test
8 | prune docs
9 | prune tools
10 | prune tutorials
11 | global-exclude *.py[co] .DS_Store
12 |
--------------------------------------------------------------------------------
/constraints.txt:
--------------------------------------------------------------------------------
1 | numpy>=1.20.0
2 | ipython<8.13;python_version<'3.9'
3 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | # You can set these variables from the command line.
14 | SPHINXOPTS =
15 | SPHINXBUILD = sphinx-build
16 | SOURCEDIR = .
17 | BUILDDIR = _build
18 | STUBSDIR = stubs
19 |
20 | # Put it first so that "make" without argument is like "make help".
21 | help:
22 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
23 |
24 | spell:
25 | @$(SPHINXBUILD) -M spelling "$(SOURCEDIR)" "$(BUILDDIR)" -W -T --keep-going $(SPHINXOPTS) $(O)
26 |
27 | clean:
28 | rm -rf $(BUILDDIR)
29 | rm -rf $(STUBSDIR)
30 |
31 | .PHONY: help spell clean Makefile
32 |
33 | # Catch-all target: route all unknown targets to Sphinx using the new
34 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
35 | %: Makefile
36 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" -W -T --keep-going $(SPHINXOPTS) $(O)
37 |
--------------------------------------------------------------------------------
/docs/_static/co2_vibration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/_static/co2_vibration.png
--------------------------------------------------------------------------------
/docs/_static/core-orbitals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/_static/core-orbitals.png
--------------------------------------------------------------------------------
/docs/_static/lattice_protein.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/_static/lattice_protein.png
--------------------------------------------------------------------------------
/docs/_static/orbitals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/_static/orbitals.png
--------------------------------------------------------------------------------
/docs/_static/runtime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/_static/runtime.png
--------------------------------------------------------------------------------
/docs/_templates/autosummary/base.rst:
--------------------------------------------------------------------------------
1 | {% if referencefile %}
2 | .. include:: {{ referencefile }}
3 | {% endif %}
4 |
5 | {{ objname }}
6 | {{ underline }}
7 |
8 | .. currentmodule:: {{ module }}
9 |
10 | .. auto{{ objtype }}:: {{ objname }}
11 |
--------------------------------------------------------------------------------
/docs/_templates/autosummary/class.rst:
--------------------------------------------------------------------------------
1 | {% if referencefile %}
2 | .. include:: {{ referencefile }}
3 | {% endif %}
4 |
5 | {{ objname }}
6 | {{ underline }}
7 |
8 | .. currentmodule:: {{ module }}
9 |
10 | .. autoclass:: {{ objname }}
11 | :show-inheritance:
12 | :no-members:
13 | :no-inherited-members:
14 | :no-special-members:
15 |
16 | {% block attributes_summary %}
17 | {% if attributes %}
18 | .. rubric:: Attributes
19 | {% for item in all_attributes %}
20 | {%- if not item.startswith('_') %}
21 | .. autoattribute:: {{ name }}.{{ item }}
22 | {%- endif -%}
23 | {%- endfor %}
24 | {% endif %}
25 | {% endblock %}
26 |
27 | {% block methods_summary %}
28 | {% if methods %}
29 | .. rubric:: Methods
30 | {% for item in all_methods %}
31 | {%- if not item.startswith('_') %}
32 | .. automethod:: {{ name }}.{{ item }}
33 | {%- endif -%}
34 | {%- endfor %}
35 | {% endif %}
36 | {% endblock %}
37 |
--------------------------------------------------------------------------------
/docs/_templates/autosummary/class_no_inherited_members.rst:
--------------------------------------------------------------------------------
1 | {% if referencefile %}
2 | .. include:: {{ referencefile }}
3 | {% endif %}
4 |
5 | {{ objname }}
6 | {{ underline }}
7 |
8 | .. currentmodule:: {{ module }}
9 |
10 | .. autoclass:: {{ objname }}
11 | :show-inheritance:
12 | :no-members:
13 | :no-inherited-members:
14 | :no-special-members:
15 |
16 | {% block attributes_summary %}
17 | {% if attributes %}
18 | .. rubric:: Attributes
19 | {% for item in all_attributes %}
20 | {%- if item not in inherited_members %}
21 | {%- if not item.startswith('_') %}
22 | .. autoattribute:: {{ name }}.{{ item }}
23 | {%- endif -%}
24 | {%- endif %}
25 | {%- endfor %}
26 | {% endif %}
27 | {% endblock %}
28 |
29 | {% block methods_summary %}
30 | {% if methods %}
31 | .. rubric:: Methods
32 | {% for item in all_methods %}
33 | {%- if item not in inherited_members %}
34 | {%- if not item.startswith('_') %}
35 | .. automethod:: {{ name }}.{{ item }}
36 | {%- endif -%}
37 | {%- endif %}
38 | {%- endfor %}
39 | {% endif %}
40 | {% endblock %}
41 |
--------------------------------------------------------------------------------
/docs/_templates/autosummary/module.rst:
--------------------------------------------------------------------------------
1 | {% if referencefile %}
2 | .. include:: {{ referencefile }}
3 | {% endif %}
4 |
5 | {{ objname }}
6 | {{ underline }}
7 |
8 | .. automodule:: {{ fullname }}
9 |
10 | {% block functions %}
11 | {% if functions %}
12 | .. rubric:: Functions
13 |
14 | .. autosummary::
15 | {% for item in functions %}
16 | {{ item }}
17 | {%- endfor %}
18 | {% endif %}
19 | {% endblock %}
20 |
21 | {% block classes %}
22 | {% if classes %}
23 | .. rubric:: Classes
24 |
25 | .. autosummary::
26 | {% for item in classes %}
27 | {{ item }}
28 | {%- endfor %}
29 | {% endif %}
30 | {% endblock %}
31 |
32 | {% block exceptions %}
33 | {% if exceptions %}
34 | .. rubric:: Exceptions
35 |
36 | .. autosummary::
37 | {% for item in exceptions %}
38 | {{ item }}
39 | {%- endfor %}
40 | {% endif %}
41 | {% endblock %}
42 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.logging.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-logging:
2 |
3 | .. automodule:: qiskit_nature.logging
4 |
5 | .. rubric:: Classes
6 |
7 | .. autosummary::
8 | QiskitNatureLogging
9 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.rst:
--------------------------------------------------------------------------------
1 | ============================
2 | Qiskit Nature API Reference
3 | ============================
4 |
5 | .. _qiskit_nature:
6 |
7 | .. automodule:: qiskit_nature
8 | :no-members:
9 | :no-inherited-members:
10 | :no-special-members:
11 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.algorithms.initial_points.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-algorithms-initial_points:
2 |
3 | .. automodule:: qiskit_nature.second_q.algorithms.initial_points
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.algorithms.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-algorithms:
2 |
3 | .. automodule:: qiskit_nature.second_q.algorithms
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.circuit.library.ansatzes.utils.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-circuit-library-ansatzes-utils:
2 |
3 | .. automodule:: qiskit_nature.second_q.circuit.library.ansatzes.utils
4 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.circuit.library.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-circuit-library:
2 |
3 | .. automodule:: qiskit_nature.second_q.circuit.library
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.circuit.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-circuit:
2 |
3 | .. automodule:: qiskit_nature.second_q.circuit
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.drivers.gaussiand.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-drivers-gaussiand:
2 |
3 | .. automodule:: qiskit_nature.second_q.drivers.gaussiand
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.drivers.psi4d.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-drivers-psi4d:
2 |
3 | .. automodule:: qiskit_nature.second_q.drivers.psi4d
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.drivers.pyscfd.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-drivers-pyscfd:
2 |
3 | .. automodule:: qiskit_nature.second_q.drivers.pyscfd
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.drivers.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-drivers:
2 |
3 | .. automodule:: qiskit_nature.second_q.drivers
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.formats.fcidump.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-formats-fcidump:
2 |
3 | .. automodule:: qiskit_nature.second_q.formats.fcidump
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.formats.qcschema.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-formats-qcschema:
2 |
3 | .. automodule:: qiskit_nature.second_q.formats.qcschema
4 |
5 | .. rubric:: Classes
6 |
7 | .. autosummary::
8 |
9 | QCBasisSet
10 | QCCenterData
11 | QCECPPotential
12 | QCElectronShell
13 | QCError
14 | QCModel
15 | QCProperties
16 | QCProvenance
17 | QCSchema
18 | QCSchemaInput
19 | QCTopology
20 | QCWavefunction
21 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.formats.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-formats:
2 |
3 | .. automodule:: qiskit_nature.second_q.formats
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.formats.watson.rst:
--------------------------------------------------------------------------------
1 | Watson
2 | =====================================
3 |
4 | .. automodule:: qiskit_nature.second_q.formats.watson
5 | :no-members:
6 | :no-inherited-members:
7 | :no-special-members:
8 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.hamiltonians.lattices.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-hamiltonians-lattices:
2 |
3 | .. automodule:: qiskit_nature.second_q.hamiltonians.lattices
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.hamiltonians.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-hamiltonians:
2 |
3 | .. automodule:: qiskit_nature.second_q.hamiltonians
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.mappers.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-mappers:
2 |
3 | .. automodule:: qiskit_nature.second_q.mappers
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.operators.commutators.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-operators-commutators:
2 |
3 | .. automodule:: qiskit_nature.second_q.operators.commutators
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.operators.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-operators:
2 |
3 | .. automodule:: qiskit_nature.second_q.operators
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.operators.symmetric_two_body.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-operators-symmetric_two_body:
2 |
3 |
4 | .. automodule:: qiskit_nature.second_q.operators.symmetric_two_body
5 | :no-members:
6 | :no-inherited-members:
7 | :no-special-members:
8 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.operators.tensor_ordering.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-operators-tensor_ordering:
2 |
3 |
4 | .. automodule:: qiskit_nature.second_q.operators.tensor_ordering
5 | :no-members:
6 | :no-inherited-members:
7 | :no-special-members:
8 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.problems.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-problems:
2 |
3 | .. automodule:: qiskit_nature.second_q.problems
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.properties.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-properties:
2 |
3 | .. automodule:: qiskit_nature.second_q.properties
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.properties.s_operators.rst:
--------------------------------------------------------------------------------
1 |
2 |
3 | s_operators
4 | =============================================
5 |
6 | .. automodule:: qiskit_nature.second_q.properties.s_operators
7 |
8 |
9 |
10 | .. rubric:: Functions
11 |
12 | .. autosummary::
13 |
14 | s_minus_operator
15 | s_plus_operator
16 | s_x_operator
17 | s_y_operator
18 | s_z_operator
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q:
2 |
3 | .. automodule:: qiskit_nature.second_q
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.second_q.transformers.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-second_q-transformers:
2 |
3 | .. automodule:: qiskit_nature.second_q.transformers
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.settings.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-settings:
2 |
3 | .. automodule:: qiskit_nature.settings
4 |
5 | .. rubric:: Classes
6 |
7 | .. autosummary::
8 | QiskitNatureSettings
9 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.testing.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-testing:
2 |
3 | .. automodule:: qiskit_nature.testing
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
--------------------------------------------------------------------------------
/docs/apidocs/qiskit_nature.utils.rst:
--------------------------------------------------------------------------------
1 | .. _qiskit_nature-utils:
2 |
3 | .. automodule:: qiskit_nature.utils
4 | :no-members:
5 | :no-inherited-members:
6 | :no-special-members:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/howtos/index.rst:
--------------------------------------------------------------------------------
1 | ###########################
2 | Qiskit Nature How-To Guides
3 | ###########################
4 |
5 | This section of the documentation provides concrete step-by-step instructions for how to
6 | do specific useful actions in Qiskit Nature.
7 |
8 | How to...
9 | ---------
10 |
11 | .. toctree::
12 | :maxdepth: 1
13 | :glob:
14 |
15 | *
16 |
17 | |
18 |
19 | If there are guides on solving specific problems that you'd like to see added, please
20 | `file an issue on GitHub `_.
21 |
22 | |
23 |
24 | .. Hiding - Indices and tables
25 | :ref:`genindex`
26 | :ref:`modindex`
27 | :ref:`search`
28 |
29 |
--------------------------------------------------------------------------------
/docs/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/images/logo.png
--------------------------------------------------------------------------------
/docs/images/overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/images/overview.png
--------------------------------------------------------------------------------
/docs/lowercase_filter.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """ Implements a Lower Case Filter for Sphinx spelling """
14 |
15 | from enchant import tokenize
16 |
17 |
18 | class LowercaseFilter(tokenize.Filter):
19 | """Lower Case Filter"""
20 |
21 | def _split(self, word):
22 | """Filter method for sub-tokenization of tokens.
23 |
24 | This method must be a tokenization function that will split the
25 | given word into sub-tokens according to the needs of the filter.
26 | The default behavior is not to split any words.
27 | """
28 | # Don't split, just lower case to test against lowercase dict
29 | return super()._split(word.lower())
30 |
--------------------------------------------------------------------------------
/docs/migration/0.5_f_protein_folding.rst:
--------------------------------------------------------------------------------
1 | Protein Folding with Qiskit Nature v0.5
2 | =======================================
3 |
4 | The keen-eyed among you will have already noticed in the `overview of
5 | the design of Qiskit Nature <./0.5_a_intro.ipynb>`__ that protein
6 | folding was not mentioned at all. The reason for that is simply that it
7 | does not align with the vision and goals of Qiskit Nature. Its status
8 | was more of a prototype than a continuously developing feature like the
9 | other parts of the package and on top of that it is really more a
10 | chemistry-inspired *optimization problem* which is not something that is
11 | currently in the scope of Qiskit Nature.
12 |
13 | Thus, the entire code related to protein folding has been migrated to
14 | the `Qiskit Research
15 | repository `__ from
16 | where you can still install and use it, just like you have done so far,
17 | except with the new import locations based on that package.
18 |
19 | We suggest that you read `the updated
20 | tutorial `__
21 | which should contain all information for you to migrate your code.
22 |
23 |
--------------------------------------------------------------------------------
/docs/migration/aux_files/h2.fcidump:
--------------------------------------------------------------------------------
1 | &FCI NORB= 2,NELEC= 2,MS2= 0,
2 | ORBSYM=1,1,
3 | ISYM=0,
4 | /
5 | 6.7571015480351648E-01 1 1 1 1
6 | 6.6458173025529665E-01 1 1 2 2
7 | 1.8093119978423133E-01 1 2 1 2
8 | 6.9857372273201834E-01 2 2 2 2
9 | -1.2563390730032502E+00 1 1 0 0
10 | -2.3575299028703285E-16 1 2 0 0
11 | -4.7189600728114062E-01 2 2 0 0
12 | 7.1996899444897966E-01 0 0 0 0
13 |
--------------------------------------------------------------------------------
/docs/migration/aux_files/qiskit_nature_0.5_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/migration/aux_files/qiskit_nature_0.5_overview.png
--------------------------------------------------------------------------------
/docs/migration/index.rst:
--------------------------------------------------------------------------------
1 | ##############################
2 | Qiskit Nature Migration Guides
3 | ##############################
4 |
5 | If you are switching over to version 0.7, which has removed all previously
6 | deprecated code, simply follow the instructions provided in the sections below.
7 |
8 | Migrating from 0.5 to 0.6
9 | -------------------------
10 |
11 | .. toctree::
12 | :maxdepth: 1
13 | :glob:
14 |
15 | 0.6*
16 |
17 | Migrating from 0.4 to 0.5
18 | -------------------------
19 |
20 | .. nbgallery::
21 | :glob:
22 |
23 | 0.5*
24 |
25 |
26 | .. Hiding - Indices and tables
27 | :ref:`genindex`
28 | :ref:`modindex`
29 | :ref:`search`
30 |
31 |
--------------------------------------------------------------------------------
/docs/release_notes.rst:
--------------------------------------------------------------------------------
1 | .. release-notes:: Release Notes
2 |
--------------------------------------------------------------------------------
/docs/tutorials/aux_files/H2_es.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/tutorials/aux_files/H2_es.png
--------------------------------------------------------------------------------
/docs/tutorials/aux_files/H2_gs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/tutorials/aux_files/H2_gs.png
--------------------------------------------------------------------------------
/docs/tutorials/aux_files/jw_mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/tutorials/aux_files/jw_mapping.png
--------------------------------------------------------------------------------
/docs/tutorials/aux_files/lattice_protein.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/tutorials/aux_files/lattice_protein.png
--------------------------------------------------------------------------------
/docs/tutorials/aux_files/vqe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/docs/tutorials/aux_files/vqe.png
--------------------------------------------------------------------------------
/docs/tutorials/index.rst:
--------------------------------------------------------------------------------
1 | #######################
2 | Qiskit Nature Tutorials
3 | #######################
4 |
5 | .. note::
6 |
7 | On this page you find a number of tutorials covering various topics of Qiskit
8 | Nature. These are good references if you are just getting started with Qiskit
9 | Nature.
10 |
11 | However, the code base provides a significant amount of functionality and advanced capability, and these
12 | tutorials below do **not** cover usage of `all` of the features, at the different levels, that are available in
13 | Qiskit Nature.
14 | In fact, Qiskit Nature is a very modular and flexible code, so if you really
15 | want to learn more, we suggest that you explore the API reference and code
16 | directly.
17 |
18 | That said, if you learn about a feature which you think deserves its own
19 | tutorial, feel free to add it to this list by
20 | `opening a pull request `_.
21 |
22 |
23 | .. note::
24 |
25 | If you are looking for more concise advice, check out the `How-Tos `_.
26 |
27 |
28 | .. nbgallery::
29 | :glob:
30 |
31 | *
32 |
33 |
34 | .. Hiding - Indices and tables
35 | :ref:`genindex`
36 | :ref:`modindex`
37 | :ref:`search`
38 |
39 |
--------------------------------------------------------------------------------
/mypy.ini:
--------------------------------------------------------------------------------
1 | [mypy]
2 | warn_unused_configs = True
3 | ignore_missing_imports = True
4 | strict_optional = False
5 | no_implicit_optional = True
6 | warn_redundant_casts = True
7 | warn_unused_ignores = True
8 |
9 | ### Output
10 | show_error_codes = True
11 | show_error_context = True
12 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["setuptools"]
3 | build-backend = "setuptools.build_meta"
4 |
5 | [tool.black]
6 | line-length = 100
7 | target-version = ['py38', 'py39', 'py310', 'py311']
8 |
--------------------------------------------------------------------------------
/qiskit_nature/VERSION.txt:
--------------------------------------------------------------------------------
1 | 0.8.0
2 |
--------------------------------------------------------------------------------
/qiskit_nature/exceptions.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Nature Exception."""
14 |
15 | from qiskit.exceptions import QiskitError
16 |
17 |
18 | class QiskitNatureError(QiskitError):
19 | """Class for errors returned by Qiskit Nature module."""
20 |
21 | pass
22 |
23 |
24 | class UnsupportMethodError(QiskitNatureError):
25 | """Class used if a driver doesn't support given method."""
26 |
27 | pass
28 |
--------------------------------------------------------------------------------
/qiskit_nature/py.typed:
--------------------------------------------------------------------------------
1 | # Marker file for PEP 561.
2 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Second Quantization (:mod:`qiskit_nature.second_q`)
15 | ===================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q
18 |
19 | Submodules
20 | ----------
21 |
22 | .. autosummary::
23 | :toctree:
24 |
25 | algorithms
26 | circuit
27 | drivers
28 | formats
29 | hamiltonians
30 | mappers
31 | operators
32 | problems
33 | properties
34 | transformers
35 | """
36 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/algorithms/excited_states_solvers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Excited State Solving Algorithms (:mod:`qiskit_nature.second_q.algorithms.excited_states_solvers`)
15 | ==================================================================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q.algorithms.excited_states_solvers
18 |
19 | """
20 |
21 | from .excited_states_solver import ExcitedStatesSolver
22 | from .qeom import QEOM, QEOMResult, EvaluationRule
23 | from .excited_states_eigensolver import ExcitedStatesEigensolver
24 |
25 | __all__ = [
26 | "ExcitedStatesSolver",
27 | "ExcitedStatesEigensolver",
28 | "QEOM",
29 | "QEOMResult",
30 | "EvaluationRule",
31 | ]
32 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/algorithms/ground_state_solvers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Ground State Solving Algorithms (:mod:`qiskit_nature.second_q.algorithms.ground_state_solvers`)
15 | ===============================================================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q.algorithms.ground_state_solvers
18 |
19 | """
20 |
21 | from .ground_state_solver import GroundStateSolver
22 | from .ground_state_eigensolver import GroundStateEigensolver
23 |
24 | __all__ = [
25 | "GroundStateSolver",
26 | "GroundStateEigensolver",
27 | ]
28 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/circuit/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Circuit (:mod:`qiskit_nature.second_q.circuit`)
15 | =======================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q.circuit
18 |
19 |
20 | .. autosummary::
21 | :toctree:
22 |
23 | library
24 | """
25 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/circuit/library/ansatzes/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 | """Qiskit Nature Circuit Library Ansatzes."""
13 |
14 | from .chc import CHC
15 | from .puccd import PUCCD
16 | from .puccsd import PUCCSD
17 | from .succd import SUCCD
18 | from .ucc import UCC
19 | from .uccsd import UCCSD
20 | from .uvcc import UVCC
21 | from .uvccsd import UVCCSD
22 |
23 | __all__ = [
24 | "CHC",
25 | "PUCCD",
26 | "PUCCSD",
27 | "SUCCD",
28 | "UCC",
29 | "UCCSD",
30 | "UVCC",
31 | "UVCCSD",
32 | ]
33 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/circuit/library/ansatzes/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Excitation generator utilities (:mod:`qiskit_nature.second_q.circuit.library.ansatzes.utils`)
15 | =============================================================================================
16 | Utility methods to build fermionic and vibrational excitations.
17 |
18 | .. currentmodule:: qiskit_nature.second_q.circuit.library.ansatzes.utils
19 | """
20 |
21 | from .fermionic_excitation_generator import generate_fermionic_excitations
22 | from .vibration_excitation_generator import generate_vibration_excitations
23 |
24 | __all__ = [
25 | "generate_fermionic_excitations",
26 | "generate_vibration_excitations",
27 | ]
28 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/circuit/library/initial_states/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 | """Qiskit Nature Circuit Library Initial States."""
13 |
14 | from .fermionic_gaussian_state import FermionicGaussianState
15 | from .hartree_fock import HartreeFock
16 | from .slater_determinant import SlaterDeterminant
17 | from .vscf import VSCF
18 |
19 | __all__ = [
20 | "FermionicGaussianState",
21 | "HartreeFock",
22 | "SlaterDeterminant",
23 | "VSCF",
24 | ]
25 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/circuit/library/initial_states/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/base_driver.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | This module implements the abstract base class for driver modules.
15 | """
16 |
17 | from abc import ABC, abstractmethod
18 |
19 | from qiskit_nature.second_q.problems import BaseProblem
20 |
21 |
22 | class BaseDriver(ABC):
23 | """
24 | Base class for Qiskit Nature drivers.
25 | """
26 |
27 | @abstractmethod
28 | def run(self) -> BaseProblem:
29 | """Returns a problem output as produced by the driver."""
30 | raise NotImplementedError()
31 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/__init__.py:
--------------------------------------------------------------------------------
1 | # This gauopen package contains code from the Gaussian Interfacing package
2 | # available at
3 | #
4 | # http://gaussian.com/interfacing/
5 | #
6 | # This source code is subject to the terms of the Gaussian Interface
7 | # Code Public License, v. 1.0. A copy of this license should have
8 | # been distributed with this file, but is also available on the
9 | # Gaussian website, http://gaussian.com/public-licensev1.0
10 | #
11 | # You may not use these files except in compliance with the License.
12 | # A copy of this License is in this package, see
13 | #
14 | # LICENSE.txt
15 | #
16 | # Unless required by applicable law or agreed to in writing, software
17 | # distributed under the License is distributed on an "AS IS" BASIS,
18 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | # See the License for the specific language governing permissions and
20 | # limitations under the License.
21 | # =============================================================================
22 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp310-win_amd64.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp310-win_amd64.pyd
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp311-win_amd64.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp311-win_amd64.pyd
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp37-win_amd64.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp37-win_amd64.pyd
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp38-win_amd64.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp38-win_amd64.pyd
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp39-win_amd64.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cp39-win_amd64.pyd
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-310-darwin.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-310-darwin.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-310-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-310-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-311-darwin.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-311-darwin.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-311-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-311-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-37m-darwin.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-37m-darwin.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-37m-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-37m-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-38-darwin.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-38-darwin.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-38-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-38-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-39-darwin.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-39-darwin.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-39-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/qiskit_nature/second_q/drivers/gaussiand/gauopen/qcmatrixio.cpython-39-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/psi4d/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Psi4 Installation
15 | =================
16 | `Psi4 `__ is an open-source program for computational chemistry.
17 | In order for Qiskit Nature to interface with Psi4, i.e. execute Psi4 to extract
18 | the electronic structure information necessary for the computation of the input to the quantum
19 | algorithm, Psi4 must be `installed `__ and discoverable on
20 | the system where Qiskit Nature is also installed.
21 | Therefore, Psi4 must be installed in the same python environment as Qiskit Nature.
22 | """
23 |
24 | from .psi4driver import Psi4Driver
25 |
26 | __all__ = ["Psi4Driver"]
27 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/pyscfd/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | PYSCF Installation
15 | ==================
16 | `PySCF `__ is an open-source library for computational chemistry.
17 | In order for Qiskit Nature to interface PySCF and execute PySCF to extract the electronic structure
18 | information, PySCF must be installed.
19 |
20 | According to the `PySCF installation instructions `__,
21 | the preferred installation method is via the pip package management system. Doing so,
22 | while in the Python virtual environment where Qiskit Nature is also installed, will
23 | automatically make PySCF available to Qiskit at run time.
24 | """
25 |
26 | from .pyscfdriver import PySCFDriver, InitialGuess
27 |
28 | __all__ = ["PySCFDriver", "InitialGuess"]
29 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/drivers/vibrational_structure_driver.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | This module implements the abstract base class for vibrational structure driver modules.
15 | """
16 |
17 | from abc import abstractmethod
18 |
19 | from qiskit_nature.second_q.problems import VibrationalBasis, VibrationalStructureProblem
20 |
21 | from .base_driver import BaseDriver
22 |
23 |
24 | class VibrationalStructureDriver(BaseDriver):
25 | """
26 | Base class for Qiskit Nature's vibrational structure drivers.
27 | """
28 |
29 | @abstractmethod
30 | def run(self, basis: VibrationalBasis) -> VibrationalStructureProblem: # type: ignore[override]
31 | # pylint: disable=arguments-differ
32 | """Returns a VibrationalStructureProblem output as produced by the driver.
33 |
34 | Args:
35 | basis: the basis in which to return the problem.
36 | """
37 | pass
38 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/formats/fcidump/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | FCIDump (:mod:`qiskit_nature.second_q.formats.fcidump`)
15 | =============================================================
16 |
17 | Contains tools to parse and dump FCIDump files.
18 |
19 | .. currentmodule:: qiskit_nature.second_q.formats.fcidump
20 |
21 | .. autosummary::
22 | :toctree: ../stubs/
23 | :nosignatures:
24 |
25 |
26 | FCIDump
27 |
28 | """
29 |
30 | from .fcidump import FCIDump
31 |
32 | __all__ = ["FCIDump"]
33 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/formats/qcschema/qc_error.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The QCSchema error dataclass."""
14 |
15 | from __future__ import annotations
16 |
17 | from dataclasses import dataclass
18 |
19 | from .qc_base import _QCBase
20 |
21 |
22 | @dataclass
23 | class QCError(_QCBase):
24 | """A dataclass to store the failure information contained in a QCSchema.
25 |
26 | For more information refer to
27 | [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#success).
28 | """
29 |
30 | error_type: str
31 | """The type of error that was raised."""
32 | error_message: str
33 | """A description of the error that was raised."""
34 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/formats/qcschema/qc_provenance.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The QCSchema provenance dataclass."""
14 |
15 | from __future__ import annotations
16 |
17 | from dataclasses import dataclass
18 |
19 | from .qc_base import _QCBase
20 |
21 |
22 | @dataclass
23 | class QCProvenance(_QCBase):
24 | """A dataclass to store the program information that generated the QCSchema file.
25 |
26 | For more information refer to
27 | [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#provenance).
28 | """
29 |
30 | creator: str
31 | """The name of the creator of this object."""
32 | version: str
33 | """The version of the creator of this object."""
34 | routine: str
35 | """The routine that was used to create this object."""
36 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/formats/watson/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | The Watson Hamiltonian (:mod:`qiskit_nature.second_q.formats.watson`)
15 | =====================================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q.formats.watson
18 |
19 | .. autosummary::
20 | :toctree: ../stubs/
21 | :nosignatures:
22 |
23 |
24 | WatsonHamiltonian
25 |
26 | """
27 |
28 | from .watson_hamiltonian import WatsonHamiltonian
29 |
30 | __all__ = [
31 | "WatsonHamiltonian",
32 | ]
33 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/hamiltonians/lattices/boundary_condition.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | This module declares the available boundary conditions.
15 | """
16 |
17 | from enum import Enum
18 |
19 |
20 | class BoundaryCondition(Enum):
21 | """Boundary condition enum."""
22 |
23 | OPEN = "open"
24 | PERIODIC = "periodic"
25 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/mappers/fermionic_mapper.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Fermionic Mapper."""
14 |
15 | from __future__ import annotations
16 |
17 | from qiskit.quantum_info import SparsePauliOp
18 |
19 | from qiskit_nature.second_q.operators import FermionicOp
20 |
21 | from .qubit_mapper import ListOrDictType, QubitMapper
22 |
23 |
24 | class FermionicMapper(QubitMapper):
25 | """Mapper of Fermionic Operator to Qubit Operator"""
26 |
27 | def map(
28 | self,
29 | second_q_ops: FermionicOp | ListOrDictType[FermionicOp],
30 | *,
31 | register_length: int | None = None,
32 | ) -> SparsePauliOp | ListOrDictType[SparsePauliOp]:
33 | return super().map(second_q_ops, register_length=register_length)
34 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/mappers/majorana_mapper.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2024, 2025.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Majorana Mapper."""
14 |
15 | from __future__ import annotations
16 |
17 | from qiskit.quantum_info import SparsePauliOp
18 |
19 | from qiskit_nature.second_q.operators import MajoranaOp
20 |
21 | from .qubit_mapper import ListOrDictType, QubitMapper
22 |
23 |
24 | class MajoranaMapper(QubitMapper):
25 | """Mapper of Majorana Operator to Qubit Operator"""
26 |
27 | def map(
28 | self,
29 | second_q_ops: MajoranaOp | ListOrDictType[MajoranaOp],
30 | *,
31 | register_length: int | None = None,
32 | ) -> SparsePauliOp | ListOrDictType[SparsePauliOp]:
33 | return super().map(second_q_ops, register_length=register_length)
34 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/mappers/spin_mapper.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Spin Mapper."""
14 |
15 | from __future__ import annotations
16 |
17 | from qiskit.quantum_info import SparsePauliOp
18 |
19 | from qiskit_nature.second_q.operators import SpinOp
20 |
21 | from .qubit_mapper import ListOrDictType, QubitMapper
22 |
23 |
24 | class SpinMapper(QubitMapper):
25 | """Mapper of Spin Operator to Qubit Operator"""
26 |
27 | def map(
28 | self,
29 | second_q_ops: SpinOp | ListOrDictType[SpinOp],
30 | *,
31 | register_length: int | None = None,
32 | ) -> SparsePauliOp | ListOrDictType[SparsePauliOp]:
33 | return super().map(second_q_ops, register_length=register_length)
34 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/mappers/vibrational_mapper.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Vibrational Mapper."""
14 |
15 | from __future__ import annotations
16 |
17 | from qiskit.quantum_info import SparsePauliOp
18 |
19 | from qiskit_nature.second_q.operators import VibrationalOp
20 |
21 | from .qubit_mapper import ListOrDictType, QubitMapper
22 |
23 |
24 | class VibrationalMapper(QubitMapper):
25 | """Mapper of Vibrational Operator to Qubit Operator"""
26 |
27 | def map(
28 | self,
29 | second_q_ops: VibrationalOp | ListOrDictType[VibrationalOp],
30 | *,
31 | register_length: int | None = None,
32 | ) -> SparsePauliOp | ListOrDictType[SparsePauliOp]:
33 | return super().map(second_q_ops, register_length=register_length)
34 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/problems/electronic_basis.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The definition of the available electronic bases."""
14 |
15 | from enum import Enum
16 |
17 |
18 | class ElectronicBasis(Enum):
19 | """An enumeration of the available electronic bases.
20 |
21 | This ``Enum`` simply names the available electronic bases.
22 | """
23 |
24 | AO = "atomic"
25 | MO = "molecular"
26 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/problems/lattice_properties_container.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The lattice properties container."""
14 |
15 | from __future__ import annotations
16 |
17 | from .properties_container import PropertiesContainer
18 |
19 |
20 | class LatticePropertiesContainer(PropertiesContainer):
21 | """The container class for lattice structure properties.
22 |
23 | Right now, this is simply an empty subclass, but lattice-specific properties might be exposed
24 | as attributes in the future.
25 | """
26 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/problems/vibrational_properties_container.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The vibrational properties container."""
14 |
15 | from __future__ import annotations
16 |
17 | from typing import cast
18 |
19 | from qiskit_nature.second_q.properties import OccupiedModals
20 |
21 | from .properties_container import PropertiesContainer
22 |
23 |
24 | class VibrationalPropertiesContainer(PropertiesContainer):
25 | """The container class for vibrational structure properties."""
26 |
27 | @property
28 | def occupied_modals(self) -> OccupiedModals | None:
29 | """Returns the occupied modals property."""
30 | return cast(OccupiedModals, self._getter(OccupiedModals))
31 |
32 | @occupied_modals.setter
33 | def occupied_modals(self, occupied_modals: OccupiedModals | None) -> None:
34 | """Sets the occupied modals property."""
35 | self._setter(occupied_modals, OccupiedModals)
36 |
--------------------------------------------------------------------------------
/qiskit_nature/second_q/transformers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Transformers (:mod:`qiskit_nature.second_q.transformers`)
15 | =========================================================
16 |
17 | .. currentmodule:: qiskit_nature.second_q.transformers
18 |
19 | .. autosummary::
20 | :toctree: ../stubs/
21 | :nosignatures:
22 |
23 | BaseTransformer
24 | BasisTransformer
25 | ActiveSpaceTransformer
26 | FreezeCoreTransformer
27 | """
28 |
29 | from .base_transformer import BaseTransformer
30 | from .basis_transformer import BasisTransformer
31 | from .active_space_transformer import ActiveSpaceTransformer
32 | from .freeze_core_transformer import FreezeCoreTransformer
33 |
34 | __all__ = [
35 | "BaseTransformer",
36 | "BasisTransformer",
37 | "ActiveSpaceTransformer",
38 | "FreezeCoreTransformer",
39 | ]
40 |
--------------------------------------------------------------------------------
/qiskit_nature/testing/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Testing utilities (:mod:`qiskit_nature.testing`)
15 | ================================================
16 |
17 | .. currentmodule:: qiskit_nature.testing
18 |
19 | Random sampling utilities
20 | -------------------------
21 |
22 | .. autosummary::
23 | :toctree: ../stubs/
24 | :nosignatures:
25 |
26 | random_antisymmetric_matrix
27 | random_quadratic_hamiltonian
28 | random_two_body_tensor_real
29 | """
30 |
31 | from .random import (
32 | random_antisymmetric_matrix,
33 | random_quadratic_hamiltonian,
34 | random_two_body_tensor_real,
35 | )
36 |
37 | __all__ = [
38 | "random_antisymmetric_matrix",
39 | "random_quadratic_hamiltonian",
40 | "random_two_body_tensor_real",
41 | ]
42 |
--------------------------------------------------------------------------------
/qiskit_nature/units.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """
14 | Enumerates various unit types.
15 | """
16 |
17 | from enum import Enum
18 |
19 |
20 | class DistanceUnit(Enum):
21 | """An enumeration of distance units."""
22 |
23 | ANGSTROM = "Angstrom"
24 | BOHR = "Bohr"
25 |
--------------------------------------------------------------------------------
/qiskit_nature/utils/opt_einsum.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Optimized einsum utilities."""
14 |
15 | from __future__ import annotations
16 |
17 | from typing import Callable
18 | import numpy as np
19 | import qiskit_nature.optionals as _optionals
20 |
21 |
22 | def get_einsum() -> tuple[Callable, bool]:
23 | """Returns the ``einsum`` implementation.
24 |
25 | This returns a tuple of a callable and boolean. The callable is the ``einsum`` implementation.
26 | If ``opt_einsum`` is installed, ``opt_einsum.contract`` will be used. Otherwise this falls
27 | back to ``np.einsum``. The boolean indicates support for sparse arrays.
28 |
29 | Returns:
30 | The pair of the ``einsum`` callable and sparse support indicator.
31 | """
32 | if _optionals.HAS_OPT_EINSUM:
33 | # pylint: disable=import-error
34 | from opt_einsum import contract
35 |
36 | return contract, True
37 |
38 | return np.einsum, False
39 |
--------------------------------------------------------------------------------
/releasenotes/config.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | encoding: utf8
3 | default_branch: main
4 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/add-bksf-mapper-7826652bfa4403a6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add :class:`qiskit_nature.mappers.second_quantization.BravyiKitaevSuperFastMapper` implementing
5 | the Bravyi-Kitaev super-fast fermion-to-qubit mapping. For example
6 |
7 | .. code-block:: python
8 |
9 | from qiskit_nature.mappers.second_quantization import BravyiKitaevSuperFastMapper
10 | mapper = BravyiKitaevSuperFastMapper()
11 | mapper.map(fermionic_op)
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/add-fermionicop-label-mode-a1faa97811dac9b4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | The internal data in :class:`~qiskit_nature.operators.second_quantization.FermionicOp`
5 | have been changed. As a result, more data type is now accepted by initialize.
6 | The ascending order constraint and the no-same index constraint have been removed.
7 | In addition, the dense and sparse labels are now automatically detected by the existence of
8 | underscores.
9 |
10 | The property `display_format` of :class:`~qiskit_nature.operators.second_quantization.FermionicOp`
11 | is added. There are two modes `dense` and `sparse`.
12 | This display format can be switched by the property `FermionicOp.display_format`.
13 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/add-hermiticity-checks-secondquantizedops-c9b28597bb9ec6a0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The :class:`~qiskit_nature.operators.SecondQuantizedOp` now has a method
5 | :meth:`~qiskit_nature.operators.SecondQuantizedOp.is_hermitian()` method which will
6 | return ``True`` if the operator is equivalent to its adjoint and ``False`` otherwise
7 |
8 | - |
9 | :meth:`~qiskit_nature.operators.SecondQuantizedOp.to_list()` is now an abstract method of
10 | :class:`~qiskit_nature.operators.SecondQuantizedOp` that is implemented by all subclasses
11 |
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/bugfix-fermionicop-init-4005d72e38ba67f4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixed an issue where :class:`~qiskit_nature.operators.FermionicOp` raises
5 | unwanted `ValueError` when initialized with some list of sparse label.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/bugfix-totaldipole-0e2271edcdd45cb0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the issue #198 where total dipole moment was not calculated correctly in the
5 | `ElectronicStructureResult`.
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/consistent-qiskit-nature-branding-470b2ca1d55ec7b6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | other:
3 | - |
4 | Changed documentation and code to better reflect rebranding of Qiskit's
5 | chemistry module as Qiskit Nature.
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/deprecate-evolved-operator-ansatz-9ddf9002667cc914.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | The :class:`~qiskit_nature.circuit.library.EvolvedOperatorAnsatz` is deprecated.
5 | Use :class:`~qiskit.circuit.library.EvolvedOperatorAnsatz` as a direct replacement instead.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/fermionicop-normal-order-cd550917dff142fc.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add :meth:`~qiskit_nature.operators.second_quantization.FermionicOp.to_normal_order()`.
5 | It returns the normal ordered fermionic operator that is equivalent to self.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/fix-active-space-error-formatting-79e4126b65004feb.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | ``QiskitNatureError``s where not being raised properly by the ``ActiveSpaceTransformer`` due to
5 | ill-formatted error messages.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/fix-adapt-vqe-c9df0c06ea352b91.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix :class:`~qiskit_nature.algorithms.AdaptVQE` after the update of
5 | :class:`~qiskit.algorithms.VQE` which deleted the internal ``_energy_evaluation``
6 | method that Adapt-VQE was relying on.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/fix-incompatibility-of-freeze-core-and-z2symmetry-1b5caa71986abaee.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The `FreezeCoreTransformer` (and `ActiveSpaceTransformer`) were incompatible with the automatic
5 | `Z2Symmetry` reduction. This issue was fixed by correcting the
6 | `ElectronicStructureProblem.symmetry_sector_locator` method.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/molecule-driver-762847a396e6bc9e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Introduces the :class:`~qiskit_nature.drivers.second_quantization.ElectronicStructureMoleculeDriver` and
5 | :class:`~qiskit_nature.drivers.second_quantization.VibrationalStructureMoleculeDriver`
6 | that allow for the creation of Molecule-based drivers by specifying a molecule plus basis and
7 | method (for Electronic Structure drivers only) and a driver type. An additional type `AUTO` allows for
8 | the lookup of the first driver installed that supports the given method. The documentation of
9 | those two molecule driver classes gives more details on it.
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/port-star-algebra-1727d74437c48390.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | The internal API of the abstract class
5 | :class:`qiskit_nature.operators.second_quantization.SecondQuantizedOp` abstract class has been
6 | changed to use :class:`~qiskit.opflow.mixins.StarAlgebraMixin`.
7 | deprecations:
8 | - |
9 | The property `dagger` in the second quantized operators is deprecated. Use `adjoint()` method
10 | alternatively.
11 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/property-framework-a3a3239ab9ad52df.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The Property framework is the new modular and extensible approach for
5 | representing observable quantities. The framework is used as a replacement
6 | for the legacy driver results like `QMolecule` and `WatsonHamiltonian`.
7 | Please refer to the tutorial and documentation for more details.
8 | Related Github issues:
9 | * https://github.com/Qiskit/qiskit-nature/issues/148
10 | * https://github.com/Qiskit/qiskit-nature/issues/167
11 | * https://github.com/Qiskit/qiskit-nature/pull/220
12 | * https://github.com/Qiskit/qiskit-nature/issues/243
13 | * https://github.com/Qiskit/qiskit-nature/pull/263
14 | * https://github.com/Qiskit/qiskit-nature/issues/264
15 | * https://github.com/Qiskit/qiskit-nature/pull/303
16 | deprecations:
17 | - |
18 | * the legacy driver return types, `QMolecule` and `WatsonHamiltonian`
19 | * the legacy transformers acting on the now deprecated driver return types
20 | * the `BaseProblem.molecule_data` and `BaseProblem.molecule_data_transformed` attributes
21 |
22 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/relocate-drivers-fac59a504b5bc986.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | All currently existing drivers have been moved from `qiskit_nature.drivers`
5 | to `qiskit_nature.drivers.second_quantization`. This is necessary because
6 | future additions to Nature which reside in parallel to the
7 | `second_quantization` submodules will not be using these drivers. Making
8 | this separation reflects that in the code structure.
9 | The same change was necessary for the existing `qiskit_nature.transformers`.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/runtime-vqe-program-4a860e71ba53a780.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Introduce the :class:`~qiskit_nature.runtime.VQEProgram` to allow leveraging Qiskit
5 | Runtime to speed up the VQE algorithm. The :class:`~qiskit_nature.runtime.VQEProgram`
6 | implements the :class:`~qiskit.algorithms.MinimumEigensolver` interface and can thus
7 | be used as a drop-in replacement for other minimum eigensolvers like
8 | :class:`qiskit.algorithms.VQE`. See the tutorials under `docs/tutorials` for an
9 | explicit example usage.
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/skip-two-qubit-reduction-when-too-small-50ab22e9155db918.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The two-qubit reduction needs to be skipped when a qubit operator only has 2
5 | (or even fewer) qubits.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/vqeprogram-aux-operators-9db380d8e20b1f1d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The :class:`~qiskit_nature.runtime.VQEProgram` does support the evaluation of auxiliary
5 | operators at the final state, but the
6 | :meth:`qiskit_nature.runtime.VQEProgram.supports_aux_operators` method previously returned
7 | `False` instead of `True`.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.2/vqeprogram-optimizers-cd23307c10fcd15b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Allow Qiskit's :class:`~qiskit.algorithms.optimizers.Optimizer` classes as input for
5 | the ``optimizer`` in the :class:`~qiskit_nature.runtime.VQEProgram` instead of only
6 | dictionaries.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/add-getter-and-setter-degrees_of_freedom-5f150869ea94e54a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The `degree_of_freedom` attribute of the :class:`~qiskit_nature.drivers.Molecule` class now has its dedicated getter and setter.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/add-ising-model-3f6e53c0281bf4a5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.models.IsingModel`
5 | implementing the Hamiltonian of the Ising Model.
6 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.models.LatticeModel`
7 | implementing a base class for Lattice models.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/add-lattice-module-7b51630da1cc5d1b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.lattice.Lattice`
5 | for the generation of general lattices.
6 |
7 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.lattice.HyperCubicLattice`
8 | for the generation of arbitrary d-dimensional lattices.
9 |
10 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.lattice.LineLattice`
11 | for the generation of one-dimensional lattices.
12 |
13 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.lattice.SquareLattice`
14 | for the generation of two-dimensional lattices.
15 |
16 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.lattice.TriangularLattice`
17 | for the generation of two-dimensional lattices with diagonal edges.
18 |
19 | Add: :class:`qiskit_nature.problems.second_quantization.lattice.models.FermiHubbardModel`
20 | implementing the Hamiltonian of the Fermi-Hubbard Model.
21 |
22 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/expose-callback-on-vqe-factories-951fadf826d6be7a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Exposes the `callback` option of the `VQE` algorithm in the VQE factory classes. It also adds a
5 | general `kwargs` dictionary which allows passing any additional arguments to the VQE.
6 | fixes:
7 | - |
8 | This also ensures that the getter/setter methods of the VQE factories actually affect the
9 | constructed VQE instance.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/fermionic-op-to-matrix-4abd3f1b53f6e6d5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add :meth:`~qiskit_nature.operators.second_quantization.FermionicOp.to_matrix()`.
5 | This method returns the matrix representation of the operator over the full fermionic Fock space in
6 | the occupation number basis.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/fix-active-space-transformer-non-singlet-manual-selection-d022bdbfaccc7e65.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixed the manual active orbital selection when specifying the active number
5 | of electrons as a tuple rather than an integer.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/fix-electronic-energy-orbital-energies-603034a6b424818a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixed a typo in the `ElectronicEnergy._orbital_energies` variable name and
5 | ensures the correct behavior of the `orbital_energies` property getter.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/fix-electronic-structure-result-printing-3564bc515f252a9a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The `ElectronicStructureResult` did not initialize the `_computed_dipole_moment` variable causing
5 | critical errors when trying to print a result from an algorithm which does not compute these
6 | observables. Proper initialization fixes this issue.
7 | Printing the result would also fail when `complex` numbers were stored. This has also been remedied.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/fix-mapper-bug-8eba9d219595b8e1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixed an issue where the existing Mapper was incorrectly mapping the creation operator :math:`+`
5 | and the annihilation operator :math:`-`. It used to be that :math:`+` was mapped to
6 | :math:`\sigma_+` and :math:`-` was mapped to :math:`\sigma_-`, but it is correct that
7 | :math:`+` is mapped to :math:`\sigma_-` and :math:`-` is mapped to :math`\sigma_+`.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/gaussian-py39-1c519a1bb2f370d3.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added Gaussian drivers to allow execution on python 3.9 (MacOS, Windows, Linux).
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/generalized-fermionic-excitations-1d345d179e097896.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Support was added for generalized fermionic excitations. These kinds of
5 | excitations are effectively ignoring the orbital occupancies and instead
6 | yield all possible excitations within a spin species.
7 | Furthermore, another option was added which can be used to enabled spin-
8 | flipped excitations.
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/legacy-molecule-data-transformed-d6ca735fe8332739.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Ensure `BaseProblem.molecule_data_transformed` is set when using a legacy
5 | driver type without any transformers.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/print-vibrational-excited-state-energies-0ea51457b3a4a69f.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the formatting of the occupied modals and adds the excited state energies
5 | when printing a :class:`~qiskit_nature.results.VibrationalStructureResult`.
6 |
7 | Fixes the return type of
8 | :meth:`~qiskit_nature.results.VibrationalStructureResult.num_occupied_modals_per_mode`
9 | from ``Optional[List[float]]`` to ``Optional[List[List[float]]]``
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/qeom_fix-4341f74549f22891.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes QEOM such that when using parity mapping with two_qubit_reduction,
5 | or Z2 symmetries with any mapping, that the excited states are computed
6 | as expected.
7 |
8 | Fix the electronic structure problem sector locator such that the 'auto'
9 | Z2 symmetry conversion, of the qubit converter, results in the ground state
10 | for such problems and not some other value due to incorrect sector selection.
11 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/remove_deprecated_evopansatz-36c3c872419a4329.yaml:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | upgrade:
4 | - |
5 | The `EvolvedOperatorAnsatz`, from the Nature circuit.library, which was migrated in
6 | an earlier release to core Qiskit i.e. Terra, has now been removed. You should change
7 | any code that still uses this over to the core Qiskit one, from `qiskit.circuit.library`,
8 | as a direct replacement.
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/rename-runtime-program-9afac6a99a6de213.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | Rename the runtime "program" to runtime "client" to avoid name confusions and
5 | reflect the fact that it is an interface for code executed in the cloud. The classes
6 | :class:`~qiskit_nature.runtime.VQEProgram` and
7 | :class:`~qiskit_nature.runtime.VQEProgramResult` have been renamed to
8 | :class:`~qiskit_nature.runtime.VQEClient`,
9 | :class:`~qiskit_nature.runtime.VQERuntimeResult`, respectively.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/sparse-input-to-bksf-fd803ea1e9d05d2d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Allow input operator to BravyiKitaevSuperFastMapper to be FermionicOp in
5 | sparse storage format. Previously, all input was interpreted as dense storage
6 | format, which raised an error when parsing sparse format as dense failed.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/ucc-check-excitations-4fb34977b9b0c1d1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Runs checks for the excitations in a UCC ansatz when the excitations were created by a function.
5 | If the excitations are not in the expected format the checks raise a
6 | :class:`qiskit_nature.QiskitNatureError`.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.3/update-runtime-tutorial-20378bfd85b719df.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Updates the runtime tutorial to consistently use the new drivers in
5 | combination with the new transformers and the Property-framework in general.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/BOPERSampler-supports-MinimumEigensolverFactories-d920a7870d7e265d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The :class:`~qiskit_nature.algorithms.per_samplers.boper_sampler.BOPESSampler` did not support
5 | GroundStateSolvers when built out with MinimumEigensolverFactories.
6 | This is fixed, so code like the following now functions correctly:
7 |
8 | .. code-block:: python
9 |
10 | solver = GroundStateEigensolver(converter, VQEUCCFactory(quantum_instance))
11 | sampler = BOPESSampler(solver, bootstrap=True, num_bootstrap=None, extrapolator=None)
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/add-logging-171aceb37c21a3d5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added logging utility functions accessible through `qiskit_nature.logging`.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/add-python310-support-6ef188b2e1572cc8.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | Added support for running with Python 3.10.
5 | At the the time of the release, PySCF didn't have a python 3.10 version.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/added_support-of-bohr-unit-4b27ef4b89f7ee32.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added Support for Bohr unit in Molecule Class:
5 |
6 | .. code-block:: python
7 |
8 | mol = Molecule(geometry=[("H", [10.0, 2.0, 0.0]), ("H", [0.0, 20.0, 1.0])], unit=UnitsType.BOHR)
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/bksf-fix-corner-cases-7f66d695fc316e9a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix incorrect corner cases in BravyiKitaevSuperFastMapper: Input terms with
5 | coefficient zero and output operator equal to zero. Also detect and raise
6 | an exception if HartreeFock attempts to use the BKSF mapper.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/bksf-fix-op-compose-bc8161a50bf9acaa.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix bug in Bravyi-Kitaev Super-Fast (BKSF) Mapper cause by using obsolete
5 | method for composing Pauli operators in one kind of fermionic Hamiltonian
6 | term.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/bogoliubov-transform-885eb6442172c76e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds :class:`~.BogoliubovTransform`.
5 | This class constructs a circuit that performs a Bogoliubov transform,
6 | which is a single-particle basis change that may or may not conserve
7 | particle number. See the
8 | `Quadratic Hamiltonians and Slater determinants `_ tutorial
9 | for a demonstration of how to use this class.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/dict_based_aux_ops_in_vqeclient-cef82ff240b51650.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a bug in VQEClient using dict based `aux_operators` instead of deprecated
5 | list based ones (enabled via `qiskit_nature.settings.dict_aux_operators = True`).
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/drop-python3.6-support-ea12d78ea8616c74.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | Support for running with Python 3.6 has been removed. To run Nature you need
5 | a minimum Python version of 3.7.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/einsum-optimization-27ae7457599e578e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The new setting `qiskit_nature.settings.optimize_einsum` was added which allows enabling the
5 | `optimize` argument in `numpy.einsum` calls with more than 2 operands. This is known to yield
6 | significant computational efficiency increases at the expense of higher memory consumption.
7 | The setting defaults to `True`.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fermionicop-iter-a60ae0ed7e3cff1e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds :meth:`qiskit_nature.operators.second_quantization.FermionicOp.terms`.
5 | This returns an iterable of
6 | (term, coefficient) pairs describing the terms contained in the operator.
7 | Each term is a list of tuples of the form (action, index), where the action
8 | is either "+" or "-" and the index is the integer index of the factor in
9 | the term.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fermionicop-sparse-format-3aa7c9d52b9396e4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | Changes the default ``display_format`` of the constructor of
5 | :class:`~qiskit_nature.operators.second_quantization.FermionicOp` from "dense" to "sparse".
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-as-trafo-grouped-property-iteration-bca2096817b1e497.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Some minor issues in the :class:`~qiskit_nature.transformers.second_quantization.electronic.ActiveSpaceTransformer`
5 | were fixed. Namely:
6 |
7 | - iterated properties are no longer deep-copied resulting in non-transformed ones actually being dropped rather than carried on
8 | - the correct return type object is being constructed and returned
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-freeze-core-372ac9f9d3ffd4c0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the ability to disable the `freeze_core` argument of the
5 | :class:`~qiskit_nature.transformers.second_quantization.electronic.FreezeCoreTransformer`
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-inference-of-register-length-cf23f13a477e9e57.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the wrong inference of register_length in
5 | :class:`~qiskit_nature.operators.second_quantization.FermionicOp`.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-molecule-coordinate-units-61f109372dcf7842.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the units used for the Molecule generated by the `PySCFDriver`.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-non-singlet-occupation-computation-f2ff44b144b53732.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the computation of the spin orbital occupation in a non-singlet state.
5 | Previously, a singly occupied MO would result in SO occupations of `0.5` for each spin.
6 | Now, the alpha SO will be fully occupied and the beta SO unoccupied.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix-transpile-uccsd-db7f2557e6155017.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | :class:`~qiskit_nature.circuit.library.ansatzes.UCC` and
5 | :class:`~qiskit_nature.circuit.library.ansatzes.UVCC` when
6 | fully configured via the constructor failed to transpile and were not valid circuits.
7 | This fixes that to ensure that if `UCC` / `UVCC` are fully configured then as circuits
8 | they are are immediately valid from the get go.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix_groundenergy-f973527ae6296c59.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix the `groundenergy` in :class:`~qiskit_nature.results.EigenstateResult`
5 | to return a correct value.
6 |
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/fix_uccsd_op_build-6b0bc1de57f3e423.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Alter :class:`~qiskit_nature.circuit.library.UCC` to build the ``operators`` on demand
5 | when requested via the property, rather than, as before, when the circuit is built.
6 | Now if the circuit is built, then the operators, if not built, will be created as before,
7 | but since they are cached when built, if done earlier, then these are used. This avoids
8 | problems when used in conjunction with VQE that presently fail - most cases today
9 | use a fully configured UCC being passed into VQE but whose constructor presently has an
10 | unintended side-effect of building the circuit via a logging statement. For other
11 | scenarios VQE would fail when it checked on number of qubits and the operators were None,
12 | even though UCC was fully configured, when the circuit had not yet been built.
13 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/hdf5-driver-bafbbd8e70ee15a6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The HDF5Driver has been refactored to leverage the new HDF5-integration
5 | protocol of Qiskit Nature. The driver still supports loading legacy
6 | QMolecule HDF5 files and also provides a conversion utility:
7 |
8 | .. code-block:: python
9 |
10 | driver = HDF5Driver("path_to_qmolecule.hdf5")
11 | driver.convert(replace=True)
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/hdf5-integration-b08c31426d1fdf9e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new HDF5-integration to support storing and loading of (mostly)
5 | Property objects using HDF5 files. A similar feature existed in the legacy
6 | QMolecule object but the new implementation is handled more general to
7 | enable leveraging this integration throughout more parts of the stack in the
8 | future.
9 |
10 | To store a driver result of the new drivers in a file you can do:
11 |
12 | .. code-block:: python
13 |
14 | from qiskit_nature.hdf5 import save_to_hdf5
15 |
16 | my_driver_result = driver.run()
17 | save_to_hdf5(my_driver_result, "my_driver_result.hdf5")
18 |
19 | and to load it again you would do:
20 |
21 | .. code-block:: python
22 |
23 | from qiskit_nature.hdf5 import load_from_hdf5
24 |
25 | my_driver_result = load_from_hdf5("my_driver_result.hdf5")
26 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/initialize-ferop-with-tuple-as-label-0dc3f1dbd754ca29.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Support the initialization of FermionicOp with tuple as label.
5 | :class:`~qiskit_nature.operators.second_quantization.FermionicOp` can be initialized using
6 | a tuple of integers, `(action, index)`, like below::
7 |
8 | from qiskit_nature.operators.second_quantization import FermionicOp
9 |
10 | FermionicOp(
11 | [([("-", 2), ("+", 1)], 2 + 0j), ([("-", 3)], 34 + 0j)],
12 | register_length=4,
13 | display_format="sparse",
14 | )
15 |
16 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/lattice-edge-typecheck-3f5b4896fe26c8dc.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Add a type check for the input graphs to
5 | :class:`~qiskit_nature.problems.second_quantization.lattice.lattices.Lattice`
6 | which asserts that the edge weights of the graph are either numeric (or one of `None` or `{}`
7 | which is replaced by a unit weight). This prevents possibly unexpected errors in the
8 | application stack when an operator is constructed from the lattice.
9 |
10 | In particular, the following now raises a `ValueError`:
11 |
12 | .. code-block:: python
13 |
14 | from retworkx import PyGraph
15 | from qiskit_nature.problems.second_quantization.lattice import Lattice
16 |
17 | graph = PyGraph(multigraph=False)
18 | graph.add_nodes_from(range(3))
19 | graph.add_edges_from([(0, 1, 1), (1, 2, "banana")]) # banana is not a valid weight!
20 |
21 | lattice = Lattice(graph)
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/lattice-from-networkx-20c7c8119af77f36.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Add the option to initialize a :class:`~qiskit_nature.problems.second_quantization.lattice.Lattice`
5 | from a ``networkx.Graph`` object, which will be internally converted to a ``retworkx.PyGraph``
6 | for performance.
7 |
8 | For example, you can now construct a lattice as
9 |
10 | .. code-block:: python
11 |
12 | import networkx as nx
13 | from qiskit_nature.problems.second_quantization.lattice import Lattice
14 |
15 | # 3-regular random graph on 6 nodes
16 | graph = nx.generators.random_graphs.random_regular_graph(3, n=6)
17 | lattice = Lattice(graph)
18 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/lattice_model_problem-3925bfbd2267cd4c.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new problem class,
5 | :class:`qiskit_nature.problems.second_quantization.lattice.LatticeModelProblem`,
6 | for lattice models. It can create second quantized operators from a lattice model.
7 | We can use the Ground State Eigensolver with it to calculate the ground state energy.
8 |
9 | .. code-block:: python
10 |
11 | from qiskit_nature.problems.second_quantization.lattice import (
12 | BoundaryCondition, FermiHubbardModel, LineLattice, LatticeModelProblem
13 | )
14 | from qiskit.algorithms import NumPyMinimumEigensolver
15 | from qiskit_nature.algorithms import GroundStateEigensolver
16 | from qiskit_nature.converters.second_quantization import QubitConverter
17 | from qiskit_nature.mappers.second_quantization import JordanWignerMapper
18 |
19 | solver = NumPyMinimumEigensolver()
20 | qubit_converter = QubitConverter(JordanWignerMapper())
21 | calc = GroundStateEigensolver(qubit_converter, solver)
22 |
23 | line_lattice = LineLattice(num_nodes=4, boundary_condition=BoundaryCondition.OPEN)
24 | fhm = FermiHubbardModel.uniform_parameters(
25 | lattice=line_lattice,
26 | uniform_interaction=-1.0,
27 | uniform_onsite_potential=0.0,
28 | onsite_interaction=5.0,
29 | )
30 | lmp = LatticeModelProblem(lattice_model=fhm)
31 | res = calc.solve(lmp)
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/logarithmic_mapper-f655fc66d319ba08.yaml:
--------------------------------------------------------------------------------
1 | features:
2 | - |
3 | Adds :class:`qiskit_nature.mappers.second_quantization.LogarithmicMapper`.
4 | This class is a mapper for Logarithmic spin-to-qubit mapping. In this local encoding transformation, each individual spin S system is represented via
5 | the lowest lying 2S+1 states in a qubit system with the minimal number of qubits needed to
6 | represent >= 2S+1 distinct states.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/performance-two-body-second-q-op-08f906951005ebc1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Improves the performance of the
5 | :meth:`qiskit_nature.properties.second_quantization.electronic.integrals.ElectronicIntegrals.to_second_q_op`
6 | method significantly. Previously, generating the second quantized operators
7 | for a system size greater than 20 spin orbitals took on the order of minutes
8 | to hours (depending on the actual size). Now, even system sizes of 50 spin
9 | orbitals can be handled in a matter of seconds.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/quad-ham-7c98cc11f700bdc5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds :class:`qiskit_nature.operators.second_quantization.QuadraticHamiltonian`.
5 | This class is used to represent quadratic fermionic Hamiltonians
6 | and includes methods to efficiently diagonalize them.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/simplify-01d1b75c00a7eac9.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the `simplify` method to
5 | :class:`qiskit_nature.operators.second_quantization.SecondQuantizedOp`
6 | and the `normal_ordered` method to
7 | :class:`qiskit_nature.operators.second_quantization.FermionicOp`.
8 | These methods replace `reduce` and `to_normal_order`, which are deprecated.
9 | The differences between the new and old methods are the following:
10 |
11 | * `simplify` does not perform normal-ordering, while `reduce` does
12 | * `normal_ordered` simplifies the result, while `to_normal_order` does not
13 | deprecations:
14 | - |
15 | The following second quantization operator methods are deprecated:
16 |
17 | * :meth:`qiskit_nature.operators.second_quantization.SecondQuantizedOp.reduce`.
18 | Instead, use :meth:`qiskit_nature.operators.second_quantization.SecondQuantizedOp.simplify`.
19 | * :meth:`qiskit_nature.operators.second_quantization.FermionicOp.to_normal_order`.
20 | Instead, use :meth:`qiskit_nature.operators.second_quantization.FermionicOp.normal_ordered`.
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/slater-53415163fff84313.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds functionality to prepare Slater determinants and fermionic Gaussian states
5 | using the Givens rotation strategy. This functionality is accessed via the
6 | following classes:
7 |
8 | * :class:`qiskit_nature.circuit.library.SlaterDeterminant`
9 | * :class:`qiskit_nature.circuit.library.FermionicGaussianState`
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/support_excitedstatessolver_bopes-2bbb5a282b1ff582.yaml:
--------------------------------------------------------------------------------
1 | features:
2 | - |
3 | The solver of :class:`~qiskit_nature.algorithms.pes_samplers.BOPESSampler` now accepts solvers of type
4 | `Union[GroundStateSolver,ExcitedStatesSolver]` instead of only a `GroundStateSolver`.
5 | This generalizes to excited states the sampling
6 | of nuclear coordinates for Born Oppenheimer Potential Energy Surfaces.
7 | Adds the `get_qubit_operators()` in :class:`qiskit_nature.algorithms.ExcitedStatesEigensolver`.
8 | This matches the format of :class:`qiskit_nature.algorithms.GroundStateEigensolver`.
9 | BOPESSampler now also accepts auxiliary operators to pass to the solver.
10 | Geometry-dependent observable can also be defined as auxiliaries.
11 | See the `Sampling the potential energy surface `_ tutorial
12 | for a demonstration of how to use this calculation of excited state Born Oppenheimer potential energy surfaces.
13 | deprecations:
14 | - |
15 | The argument `gss` of the constructor of :class:`~qiskit_nature.algorithms.pes_samplers.BOPESSampler` was deprecated
16 | and replaced by `state_solver` to match the extension of this class to
17 | :class:`qiskit_nature.algorithms.ExcitedStatesEigensolver`.
18 | Now the constructor has the following positional argument:
19 |
20 | * state_solver
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/uvcc_op_creation-bac88e1f58c781ae.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Alter :class:`~qiskit_nature.circuit.library.UVCC` to build the ``operators`` on demand
5 | when requested via the property, rather than, as before, when the circuit is built. This
6 | is a similar change as was done to :class:`~qiskit_nature.circuit.library.UCC`.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/vibrational-truncation-order-92ebbd78cc2c29fa.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Ensures the `VibrationalStructureProblem.truncation_order` gets propagated
5 | correctly down to the properties before the `SecondQuantizedOp` instances
6 | are constructed.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/vqe-factory-improvements-02f411513f11907c.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | :class:`~qiskit_nature.algorithms.VQEUCCFactory`
5 | had setter/getter properties that were repeated with respect to
6 | :class:`qiskit.algorithms.VQE`.
7 |
8 | In order to avoid duplicating all of these attributes, potentially leading to inconsistencies
9 | between the attributes of the different classes, these are now deprecated and require you to use
10 | the attributes from
11 | :attr:`~qiskit_nature.algorithms.VQEUCCFactory.minimum_eigensolver`
12 | instead.
13 |
14 | For this reason, the constructor of
15 | :class:`~qiskit_nature.algorithms.VQEUCCFactory` has been changed as well.
16 | Now the constructor only has the following positional arguments:
17 |
18 | * initial_point
19 | * initial_state
20 | * ansatz
21 |
22 | Any extra keyword arguments are passed to a constructor of :class:`qiskit.algorithms.VQE`
23 | which will create a VQE that can be accessed via
24 | :attr:`~qiskit_nature.algorithms.VQEUCCFactory.minimum_eigensolver`.
25 |
26 | The same changes have been done for :class:`~qiskit_nature.algorithms.VQEUVCCFactory`
27 | and :class:`~qiskit_nature.algorithms.NumPyMinimumEigensolverFactory`
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.4/vqeclient-extends-variationalalg-eb5b3f951405fd16.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | :class:`~qiskit_nature.runtime.VQEClient` now extends
5 | VariationalAlgorithm, meaning users can now implement
6 | :class:`~qiskit_nature.algorithms.pes_samplers.BOPESSampler`
7 | using bootstrapping, which works similarly now with VQEClient
8 | :class:`~qiskit_nature.runtime.VQEClient` as it did previously
9 | with local VQE.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/added-heisenberg-model-218b7ca8386e208a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added the :class:`qiskit_nature.second_q.properties.HeisenbergModel`
5 | which implements the Hamiltonian of the Heisenberg model.
6 | This model is used in the study of critical points and phase transitions of magnetic systems.
7 | Through the choice of the model constants and the external magnetic field,
8 | we can produce many models like: XYZ, XXX, Ising model and others.
9 |
10 | .. code-block:: python
11 |
12 | from qiskit_nature.second_q.hamiltonians import HeisenbergModel
13 | from qiskit_nature.second_q.hamiltonians.lattices import LineLattice, BoundaryCondition
14 |
15 | line_lattice = LineLattice(num_nodes=2, boundary_condition=BoundaryCondition.OPEN)
16 | heisenberg_model = HeisenbergModel(lattice=line_lattice)
17 | print(heisenberg_model.second_q_ops())
18 | # Output: X_0 X_1 * (-1+0j) + Y_0 Y_1 * (-1+0j) + Z_0 Z_1 * (-1+0j)
19 |
20 | # These tuples allow us to define a Ising model using the HeisenbergModel
21 | J = (0.0, 0.0, -1.0)
22 | B = (1.0, 0.0, 0.0)
23 |
24 | ising_model_hm = HeisenbergModel(lattice = line_lattice, coupling_constants = J, ext_magnetic_field = B)
25 | print(ising_model_hm.second_q_ops())
26 | # Output: Z_0 Z_1 * (1+0j) + X_0 * (1+0j) + X_1 * (1+0j)
27 |
28 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/approx-eq-15521c2b1ece996b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds `.SparseLabelOp.equiv` for checking approximate equality
5 | between two SparseLabelOps.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/caching-qubit-mapper-ddfc5fae0bda18be.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The performance of the following mappers, when used to map multiple
5 | operators of identical size, is significantly improved, by means of caching
6 | internal structures used during the mapping procedure:
7 |
8 | - :class:`.JordanWignerMapper`
9 | - :class:`.ParityMapper`
10 | - :class:`.BravyiKitaevMapper`
11 | - :class:`.DirectMapper`
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/electronic-density-c1a95826c0a51ed0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new Property for the electronic structure stack to evaluate the 1-
5 | and 2-body reduced density matrices. Assuming that you already have an
6 | instance of your :class:`qiskit_nature.second_q.problems.ElectronicStructureProblem`,
7 | you can add the :class:`qiskit_nature.second_q.properties.ElectronicDensity`
8 | to it like so:
9 |
10 | .. code-block:: python
11 |
12 | problem: ElectronicStructureProblem = ...
13 |
14 | from qiskit_nature.second_q.properties import ElectronicDensity
15 |
16 | # initialize the density in an orthonormal basis simply based on the
17 | # orbital occupation numbers
18 | alpha_occupation = [1.0, 1.0, 0.0, 0.0]
19 | beta_occupation = [1.0, 1.0, 0.0, 0.0]
20 |
21 | problem.properties.electronic_density = ElectronicDensity.from_orbital_occupation(
22 | alpha_occupation, beta_occupation
23 | )
24 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/feat-properties-container-a89f4ada04ab5daa.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the :class:`~qiskit_nature.second_q.problems.PropertiesContainer` and
5 | its subclasses to simplify the handling of ``SparseLabelOpsFactory`` instances
6 | inside of problems. This container is a ``MutableSet`` and enforces at most
7 | a single instance of any Property kind to be stored inside of it This is
8 | sufficient for all application purposes of the auxiliary operators (which
9 | are generated by these objects).
10 |
11 | .. code-block:: python
12 |
13 | from qiskit_nature.second_q.problems import ElectronicPropertiesContainer
14 | from qiskit_nature.second_q.properties import ParticleNumber
15 |
16 | container = ElectronicPropertiesContainer()
17 |
18 | container.particle_number = ParticleNumber(10, 10)
19 | print(ParticleNumber in container) # True
20 |
21 | container.particle_number = None
22 | print(ParticleNumber in container) # False
23 |
24 | class MyCustomProperty:
25 | # implements the SparseLabelOpsFactory protocol
26 | ...
27 |
28 | custom = MyCustomProperty()
29 | container.add(custom)
30 | print(custom in container) # True
31 |
32 | container.discard(MyCustomProperty)
33 | print(custom in container) # False
34 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/feat-succd-mirror-kwarg-5b9f14b11d8992b9.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the new keyword argument ``mirror`` to the
5 | :class:`~qiskit_nature.second_q.circuit.library.SUCCD` ansatz, which allows
6 | the inclusion of symmetrically mirrored double excitations while preserving
7 | the number of circuit parameters.
8 |
9 | .. code-block:: python
10 |
11 | from qiskit_nature.second_q.circuit.library.ansatzes import SUCCD
12 | from qiskit_nature.second_q.mappers import JordanWignerMapper, QubitConverter
13 | converter = QubitConverter(JordanWignerMapper())
14 | ansatz = SUCCD(converter, (1, 1), 6, mirror=True)
15 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/feat-support-qcschema-1b120c18da79d4e2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds support for the `QCSchema `_
5 | via which we aim to standardize the I/O between classical drivers and Qiskit Nature.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/feat-vscf-and-hartree-as-blueprintcircuits-15167723fdd504d5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Implements both :class:`~qiskit_nature.second_q.circuit.library.HartreeFock` and
5 | :class:`~qiskit_nature.second_q.circuit.library.VSCF` as subclasses of
6 | :class:`~qiskit.circuit.library.BlueprintCircuit`. This allows the respective classes to be
7 | instantiated without explicitly setting all of their instance attributes. Missing
8 | attributes can be set at a later point to complete the respective circuit definitions.
9 |
10 | .. code-block:: python
11 |
12 | from qiskit_nature.second_q.circuit.library import HartreeFock, VSCF
13 | from qiskit_nature.second_q.mappers import JordanWignerMapper, QubitConverter
14 |
15 | # Initialize Hartree-Fock initial_state without specifying
16 | # the number of particles and qubit converter.
17 | hf_state = HartreeFock(num_spatial_orbitals=4)
18 |
19 | # ...
20 |
21 | # complete circuit definition by specifying the rest of the instance attributes
22 | hf_state.qubit_converter = QubitConverter(JordanWignerMapper())
23 | hf_state.num_particles = (1,1)
24 |
25 | # ...
26 |
27 | # Similarly for VSCF
28 | vscf_state = VSCF()
29 |
30 | # ...
31 |
32 | # complete circuit definition by specifying the rest of the instance attributes
33 | vscf_state.num_modals = [2, 2]
34 |
35 | # ...
36 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-existing-initial-point-with-reps-5ca0fd2defe00539.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix the initial point classes to account for the number of times the evolved operators are
5 | repeated in the ansatz.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-gaussian-forces-driver-from-molecule-xcf-6702ec346d1d94da.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added the ``xcf`` argument to the :meth:`qiskit_nature.second_q.drivers.GaussianForcesDriver.from_molecule`
5 | which allows specifying the exchange-correlation functional to be used by Gaussian.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-generalized-non-spin-preserving-excitations-72745abc12e06c92.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the compatibility of the fermionic excitation generator options which
5 | disables spin preserving while also enabling generalized behavior.
6 | Now, combining ``generalized=True`` with ``preserve_spin=False`` results in all
7 | combinations of excitations in the given spin orbital space. De-excitations
8 | are not included and filtered accordingly.
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-initial-point-with-reps-6157ede7a3b9924a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The ``excitation_list`` property has been removed from
5 | :class:`~qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint`,
6 | :class:`~qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint`, and
7 | :class:`~qiskit_nature.second_q.algorithms.initial_points.VSCFInitialPoint`. Thus the excitation
8 | list cannot be set directly, rather this must be set via the
9 | :attr:`~qiskit_nature.second_q.algorithms.initial_points.InitialPoint.ansatz`.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-isinstance-integer-checks-50f7614393e68e87.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a bug where numpy integer objects were causing integer-based isinstance
5 | checks to fail. This also avoids such problems by explicitly converting integer
6 | values to Python integers when loading properties from HDF5 files.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-mp2-energy-correction-8a86c3f073d821d7.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Following the MP2 T2 and energy correction calculation fix, the APIs for
5 | :class:`~qiskit_nature.second_q.algorithms.initial_points.MP2InitialPoint` and
6 | :class:`~qiskit_nature.second_q.algorithms.initial_points.HFInitialPoint` have been changed
7 | slightly. After setting the ``grouped_property``, the ``total_energy`` and ``energy_correction``
8 | are now accessed via their respective properties, rather than via ``get_energy`` and
9 | ``get_energy_correction``.
10 | fixes:
11 | - |
12 | Fixed the MP2 T2 amplitudes and energy correction computation to ensure it matches the result
13 | from PySCF.
14 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-multi-line-data-support-in-gaussian-log-parsing-50e964d30d8fef00.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes an issue in the Gaussian Log parsing when the A to H data is provided
5 | across multiple instead of on a single line in the file.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-simplify-zero-fermionicop-f2f68e6f19613468.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the behavior of ``FermionicOp.simplify`` when called on a zero-operator.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-vqe-client-aux-operator-types-ef721cdc127e2fff.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the :class:`qiskit_nature.runtime.VQEClient` to correctly detect the
5 | type of the wrapped auxiliary operators. Previously, it would always wrap
6 | them into a dictionary and then fail when unwrapping them later, since it
7 | did not preserve the previously wrapped data type.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/fix-vqe-client-aux-ops-c97dd2c150dc02a8.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The gathering of the auxiliary operator results when using the VQEClient.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/is-hermitian-33d1000779fba472.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds `atol` parameter to :meth:`.SparseLabelOp.is_hermitian`.
5 | fixes:
6 | - |
7 | Fixes a bug that caused :meth:`.FermionicOp.is_hermitian` to return false negatives
8 | due to not normal-ordering.
9 | - |
10 | Fixes a bug that caused :meth:`.FermionicOp.simplify` to fail when the
11 | simplified operator is equal to zero.
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/move-qeom-hopping-op-builders-23a76b15094a4dce.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | The utility methods building out the ``QEOM`` hopping operators have been
5 | moved away from the ``BaseProblem`` interface and have been attached to the
6 | ``QEOM`` implementation itself.
7 | features:
8 | - |
9 | The supported ``excitation`` types in the QEOM code have been updated. It now
10 | exposes the full set of excitation generation functionalities provided by
11 | the internally used UCC and UVCC ansatze. In particular, this means that
12 | rather than providing a custom list of excitation tuples, a function can be
13 | set by the user which generates such a custom list.
14 | The documentation has been updated accordingly to reflect this in all places.
15 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/op-norm-3f4d73df98bc03fc.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds :meth:`.SparseLabelOp.induced_norm`.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/remove-vqeprogram-02db084331f901f0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | other:
3 | - |
4 | The classes ``VQEProgram`` and ``VQEProgramResult`` have been removed following the end
5 | of the deprecation period.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/retworkx-rustworkx-7836a84db7669814.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Changes usage of library ``retworkx`` to the new substitute ``rustworkx``.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.5/two-body-symmetry-conversion-db45518ff5fb41bd.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds utility functions for converting between chemists' and physicists' index ordering
5 | for two-body integrals. :meth:`qiskit_nature.second_q.operators.tensor_ordering.to_chemist_ordering`
6 | converts from physicists' or intermediate order to chemists', whereas
7 | :meth:`qiskit_nature.second_q.operators.tensor_ordering.to_physicist_ordering` converts to physicists'.
8 | :meth:`qiskit_nature.second_q.operators.tensor_ordering.find_index_order` returns the
9 | index-order type for a given two-body tensor.
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/0.6-prelude-fbf9f7e6b1b910fa.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | prelude: >
3 | Qiskit Nature 0.6 focuses on refactoring of the :mod:`~qiskit_nature.second_q.mappers`
4 | module. To that extent, the :class:`~qiskit_nature.second_q.mappers.QubitConverter`
5 | class has been deprecated in favor of using the various subclasses of
6 | :class:`~qiskit_nature.second_q.mappers.QubitMapper` directly.
7 | As a short example, while you were doing something similar to this until now:
8 |
9 |
10 | .. code-block:: python
11 |
12 | solver = GroundStateEigensolver(
13 | QubitConverter(ParityMapper(), two_qubit_reduction=True),
14 | VQE(...),
15 | )
16 | result = solver.solve(problem)
17 |
18 | you now simply do the following instead:
19 |
20 |
21 | .. code-block:: python
22 |
23 | solver = GroundStateEigensolver(
24 | ParityMapper(num_particles=problem.num_particles),
25 | VQE(...),
26 | )
27 | result = solver.solve(problem)
28 |
29 | Check out the `migration guide for the QubitConverter
30 | `_
31 | for more details.
32 |
33 | Besides this major refactoring, a few other changes have been done, so be sure
34 | to check out the `migration guide from 0.5 to 0.6
35 | `_.
36 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/add-python311-support-3a939c4697ecd896.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added support for running with Python 3.11.
5 | At the the time of the release, Psi4 and Sparse didn't have a python 3.11 version.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/deprecate-eigensolver-factories-91808a78261e7f6b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | Deprecated all :class:`~qiskit_nature.second_q.algorithms.MinimumEigensolverFactory`
5 | and :class:`~qiskit_nature.second_q.algorithms.EigensolverFactory` classes.
6 | Instead, users should now build the respectively generated solver instances
7 | themselves. How-to guides to detail the involved steps have been added:
8 |
9 | - :ref:`Building a NumPyEigensolver `
10 | - :ref:`Building a NumPyMinimumEigensolver `
11 | - :ref:`Using a UCC-like ansatz with VQE `
12 | - :ref:`Using a UVCC-like ansatz with VQE `
13 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/deprecate-fermionic-op-to-matrix-74b182129fbb0171.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | Deprecated the :meth:`~qiskit_nature.second_q.operators.FermionicOp.to_matrix` method.
5 | The same functionality can be achieved via the qubit-operator after applying the
6 | :class:`~qiskit_nature.second_q.mappers.JordanWignerMapper` (one only needs to
7 | adapt to the different basis state ordering due to the reversed bitstring endianness).
8 |
9 | .. code-block:: python
10 |
11 | import numpy as np
12 | from qiskit_nature.second_q.mappers import JordanWignerMapper
13 | from qiskit_nature.second_q.operators import FermionicOp
14 | from qiskit_nature.settings import settings
15 |
16 | settings.use_pauli_sum_op = False
17 |
18 | op = FermionicOp({"+_0": 1, "-_1": 1})
19 | mat = op.to_matrix().todense()
20 | jw = JordanWignerMapper().map(op)
21 |
22 | print(np.allclose(mat, jw.to_matrix(), atol=1e-8)) # prints False
23 |
24 | for pauli in jw.paulis:
25 | pauli.x = pauli.x[::-1]
26 | pauli.z = pauli.z[::-1]
27 |
28 | print(np.allclose(mat, jw.to_matrix(), atol=1e-8)) # prints True
29 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/deprecate-vqe-client-8d355440b6dcbdb4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | The :class:`.VQEClient` and its matching :class:`.VQERuntimeResult` are now
5 | deprecated. Instead, users should migrate their code to use the Qiskit
6 | Runtime Primitives. A guide on how to use this can be found
7 | `here `_.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/feat-interleaved-qubit-mapper-1f04e5b12383386e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added the :class:`~qiskit_nature.second_q.mappers.InterleavedQubitMapper`
5 | which allows wrapping of another ``FermionicMapper`` to produce qubit operators
6 | where the alpha- and beta-spin components are arranged in the qubit register
7 | in an interleaved rather than blocked order.
8 |
9 | .. code-block:: python
10 |
11 | from qiskit_nature.second_q.mappers import JordanWignerMapper, InterleavedQubitMapper
12 | from qiskit_nature.second_q.operators import FermionicOp
13 |
14 | blocked_mapper = JordanWignerMapper()
15 | interleaved_mapper = InterleavedQubitMapper(blocked_mapper)
16 |
17 | ferm_op = FermionicOp({"+_0 -_1": 1}, num_spin_orbitals=4)
18 |
19 | blocked_op = blocked_mapper.map(ferm_op)
20 | # SparsePauliOp(['IIXY', 'IIYY', 'IIXX', 'IIYX'], coeffs=[-0.25j, 0.25, 0.25, 0.25j])
21 |
22 | print(interleaved_mapper.map(ferm_op))
23 | # SparsePauliOp(['IXIY', 'IYIY', 'IXIX', 'IYIX'], coeffs=[-0.25j, 0.25, 0.25, 0.25j])
24 |
25 | The example above extends naturally to work with any scenario in which a
26 | ``FermionicMapper`` may be used like the construction of a
27 | :class:`~qiskit_nature.second_q.circuit.library.HartreeFock` initial state
28 | or :class:`~qiskit_nature.second_q.circuit.library.UCC` ansatz, for example.
29 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/feat-tensor-class-2ad38ba7246ccbd5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the new :class:`~qiskit_nature.second_q.operators.Tensor` class used
5 | internally to consistently deal with n-dimensional tensors throughout the
6 | stack. This class also exposes the
7 | :attr:`~qiskit_nature.second_q.operators.Tensor.label_template` which allows
8 | an end-user to influence the translation procedure implemented in
9 | :meth:`~qiskit_nature.second_q.operators.SparseLabelOp.from_polynomial_tensor`.
10 | - |
11 | Adds the new :attr:`~qiskit_nature.settings.tensor_unwrapping` setting which
12 | may be set to ``False`` to disable the unwrapping of internally created
13 | :class:`~qiskit_nature.second_q.operators.Tensor` objects stored inside of a
14 | :class:`~qiskit_nature.second_q.operators.PolynomialTensor`. See also
15 | :attr:`~qiskit_nature.settings.tensor_unwrapping` for more details.
16 | deprecations:
17 | - |
18 | Deprecated the default value (``True``) of
19 | :attr:`~qiskit_nature.settings.tensor_unwrapping` meaning that in the future
20 | :meth:`~qiskit_nature.second_q.operators.PolynomialTensor.__getitem__` will
21 | return objects of type :class:`~qiskit_nature.second_q.operators.Tensor`.
22 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-bind-params-a2851b14e3b8e247.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes :meth:`.SparseLabelOp.assign_parameters` failing to
5 | assign parameters recursively.
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-commutator-simplification-tolerance-09c72ce1adc0bbf0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The commutator methods :meth:`~qiskit_nature.second_q.operators.commutators.commutator`,
5 | :meth:`~qiskit_nature.second_q.operators.commutators.anti_commutator`, and
6 | :meth:`~qiskit_nature.second_q.operators.commutators.double_commutator` no longer faultily
7 | simplify the returned operator (i.e. the absolute tolerance during simplification is set to zero
8 | instead of defaulting to ``SparseLabelOp.atol``).
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-debye-dipole-0154e964da22910d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a bug when printing the :attr:`~qiskit_nature.second_q.problems.ElectronicStructureResult.total_dipole_moment_in_debye`
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-generate-fermionic-excitations-309b771ceb14761f.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes output of :func:`.generate_fermionic_excitations` when called with ``perserve_spin=False``
5 | and unequal number of alpha and beta particles
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-qcschema-reading-mixed-spin-eri-8baa797ec14f9dd5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the :meth:`.qcschema_to_problem` method to take :attr:`.QCWavefunction.eri_mo_ab`
5 | into account when :attr:`.QCWavefunction.eri_mo_ba` is not available.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-sparse-label-op-is-zero-ebeca4d6871c9642.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the behavior of :meth:`~qiskit_nature.second_q.operators.SparseLabelOp.is_zero` when
5 | called on a parameterized operator.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-sparse-label-op-numpy-type-support-759a10226357157c.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a bug when multiplying a :class:`~qiskit_nature.second_q.operators.SparseLabelOp`
5 | with numpy numeric types from the left.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-spin-op-index-order-024e76d21b08bb9a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Removes wrong sign change from :meth:`qiskit_nature.second_q.operators.SpinOp.index_order`.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-vibrational-op-commutation-5cbda6833c0d5232.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the :meth:`~qiskit_nature.second_q.operators.VibrationalOp.normal_order`
5 | method, which in turn corrects the commutation relations of this operator type.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/fix-vqe-runtime-client-tutorial-f1e6f91372f89ca5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the :class:`.VQEClient` to work properly with the latest code.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/gaussian-wheel-5f608294891f76ce.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Added missing Gaussian native libraries from package
5 | `qiskit_nature.second_q.drivers.gaussiand.gauopen` to the wheels file distribution.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/givens-fix-a12cb547cf5a1be4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a bug in which :class:`~.BogoliubovTransform` would sometimes throw an error due to an inability to
5 | cast complex numbers to floats.
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/implements-two-qubit-reduction-in-paritymapper-f88ef199f0a954b6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the new argument ``num_particles`` to the
5 | :class:`~qiskit_nature.second_q.mappers.ParityMapper` which will implement the two qubit reduction
6 | without requiring an instance of :class:`~qiskit_nature.second_q.mappers.QubitConverter`.
7 |
8 | .. code-block:: python
9 |
10 | from qiskit_nature.second_q.drivers import PySCFDriver
11 | from qiskit_nature.second_q.mappers import ParityMapper
12 |
13 | driver = PySCFDriver()
14 | driver_result = driver.run()
15 | fermionic_op, _ = driver_result.second_q_ops()
16 | mapper = ParityMapper(num_particles=(1, 1))
17 | qubit_op = mapper.map(fermionic_op)
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/numpy-based-vibrational-integrals-7343c0fa56e2e5c5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Extends the :class:`~qiskit_nature.second_q.operators.VibrationalIntegrals`
5 | to fall back to using ``numpy`` arrays when the optional ``sparse`` dependency
6 | is not installed.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/opt_einsum-f267e198d895f801.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Leverage library opt_einsum, if installed, for sparse-einsum support.
5 | This library supports einsum summation directly on sparse objects as described in its
6 | `documentation `_.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/paulisumop-replace-d1ae54d1854b301b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecates:
3 | - |
4 | Replaced all public API occurrences of :class:`~qiskit.opflow.PauliSumOp` with :class:`~qiskit.quantum_info.SparsePauliOp`:
5 |
6 | 1. in cases where the type is a function *input*, support for ``SparsePauliOp`` objects was added
7 | alongside the use of ``PauliSumOp`` objects. When providing the latter as input, a deprecation
8 | warning is raised.
9 | 2. in cases where the type is an *output* the return type now depends on the new setting
10 | :attr:`~qiskit_nature.settings.use_pauli_sum_op`. This defaults to ``True`` but raises a
11 | deprecation warning indicating it will be switched to ``False`` in the future.
12 | Users may already set it to ``False`` now, to avoid the deprecation warning.
13 | In the further future, once the ``opflow`` module gets removed, this setting will be removed
14 | again, too.
15 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/pending-deprecate-mqwv-matrix-setter-1cd9e2dfb68d1a85.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | deprecations:
3 | - |
4 | The M, Q, W, V matrix setters and M, Q, W, V matrix standard deviation setters from
5 | :class:`~qiskit_nature.second_q.algorithms.excited_states_solvers.qeom.QEOMResult`
6 | were pending deprecated and remain computable from the H and S matrices.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/qubit-mapper-improvements-4fad546226cdc035.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The new keyword argument ``register_length`` has been added to the
5 | :meth:`.QubitMapper.map` method. This allows the user to set the length of a
6 | :class:`.SparseLabelOp` before mapping it (since this length is a lower bound).
7 | deprecations:
8 | - |
9 | :attr:`.QubitMapper.allows_two_qubit_reduction` has been deprecated. There
10 | is no replacement because it is no longer needed in the new design.
11 | - |
12 | All arguments in the :class:`.QubitMapper` API (and its subclasses) which
13 | were previously called ``nmodes`` have been renamed to ``register_length``.
14 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/result-formatting-precision-d62a868cbd801a58.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the new :attr:`~qiskit_nature.second_q.problems.EigenstateResult.formatting_precision`
5 | attribute to all result objects. This attribute sets the number of decimal places to be used
6 | when formatting the result object for printing. It defaults to 12.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/testing-module-d0f545c685574af2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added :mod:`qiskit_nature.testing` to house testing utilities.
5 | Currently it contains some functions for random sampling.
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/update-api-for-qubitmapper-qubitconverter-d237a7b596d50207.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Updated the API to allow :class:`~qiskit_nature.second_q.mappers.QubitMapper` objects in places
5 | where :class:`qiskit_nature.second_q.mappers.QubitConverter` were previously required. This addition
6 | advances toward a future deprecation of :class:`~qiskit_nature.second_q.mappers.QubitConverter`.
7 | All inputs of type :class:`~qiskit_nature.second_q.mappers.QubitConverter` now support
8 | :class:`~qiskit_nature.second_q.mappers.QubitMapper` objects implementing a transformation from
9 | second quantized operators to Pauli operators. Note that the mappers currently do not support
10 | qubit reduction techniques.
11 | - |
12 | The method :meth:`~qiskit_nature.second_q.mappers.QubitMapper.map()` now supports individual operators
13 | as well as lists and dictionaries of operators.
14 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.6/vqeclient-v2-compat-5fd7a2b58cac8651.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fix support of ``BackendV2`` in the :class:`.VQEClient`. Previously, backends instantiated
5 | with the ``IBMProvider`` failed since they return backends of type ``BackendV2``, which
6 | were not correctly supported in the VQE client. Backends instantiated with the ``IBMQ``
7 | provider continue to work as before.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/0.7-prelude-169d294985170fd5.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | prelude: >
3 | Qiskit Nature has been migrated to the `qiskit-community Github organization `_
4 | to further emphasize that it is a community-driven project.
5 | To reflect this change and because we are onboarding additional codeowners and maintainers,
6 | with this version (0.7) we have decided to *remove all deprecated* code, regardless of the time of its deprecation.
7 | This ensures that the new members of the development team do not have a large bulk of legacy code to maintain.
8 |
9 | This can mean one of two things for you as the end-user:
10 |
11 | #. Nothing, if you already migrated your code and no longer rely on any deprecated features.
12 |
13 | #. Otherwise, you need to migrate your code immediately. If you cannot do that, or want to continue using some
14 | of the features that were removed, you should pin your version of Qiskit Nature to 0.6
15 |
16 | You can check out the `migration guides `_
17 | for details on how to update your code.
18 |
19 | For more context on the changes around Qiskit Nature and the other application projects as well as the algorithms
20 | library in Qiskit, be sure to read this `blog post `_.
21 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/add-hexagonal-lattice-a981f1b5c832a154.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new lattice class, :class:`~qiskit_nature.second_q.hamiltonians.lattices.HexagonalLattice`
5 | for the generation of hexagonal lattices.
6 |
7 | You construct a hexagonal lattice by specifying the number of rows and columns of hexagons.
8 | You can also specify the edge- and on-site-parameters.
9 |
10 | Below is a simple example to illustrate this:
11 |
12 | .. code-block:: python
13 |
14 | from qiskit_nature.second_q.hamiltonians.lattices import HexagonalLattice
15 |
16 | lattice = HexagonalLattice(
17 | 2,
18 | 3,
19 | edge_parameter=1.0,
20 | onsite_parameter=1.5,
21 | )
22 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/add-kagome-lattice-ba5a4867f4eab15d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new lattice class, :class:`~qiskit_nature.second_q.hamiltonians.lattices.KagomeLattice`
5 | for the generation of kagome lattices.
6 |
7 | For example, you can construct a kagome lattice with 4 and 3 unit cells in the x and y direction,
8 | respectively, which has weights 1.0 on all edges, weights 1.5 on self-loops and open boundary conditions
9 |
10 | .. code-block:: python
11 |
12 | from qiskit_nature.second_q.hamiltonians.lattices import (
13 | KagomeLattice,
14 | BoundaryCondition,
15 | )
16 |
17 | kagome = KagomeLattice(
18 | 4,
19 | 3,
20 | edge_parameter = 1.0,
21 | onsite_parameter = 1.5,
22 | boundary_condition = BoundaryCondition.OPEN
23 | )
24 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/better-angular-momentum-9de340ef91d1024a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds new operator generator functions to allow more fine-grained spin observables.
5 | The new functions are:
6 |
7 | - the :math:`S^+` operator: :func:`.s_plus_operator`
8 | - the :math:`S^-` operator: :func:`.s_minus_operator`
9 | - the :math:`S^x` operator: :func:`.s_x_operator`
10 | - the :math:`S^y` operator: :func:`.s_y_operator`
11 | - the :math:`S^z` operator: :func:`.s_z_operator`
12 |
13 | All of these functions take the number of spatial orbitals as their only argument
14 | and return the constructed :class:`.FermionicOp`.
15 |
16 | This also allows a much simpler implementation of the :class:`.AngularMomentum`
17 | which is simply the $S^2$ operator:
18 |
19 | .. math::
20 |
21 | S^2 = S^- S^+ + S^z (S^z + 1)
22 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/bosonic-operator-and-mapper-45bfde873f092681.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Introduced a new feature that implements the bosonic operator :class:`.BosonicOp`.
5 | Its functionalities are analogous to the :class:`.FermioniOp`, but for commuting bosonic particles.
6 | It should be used to represent a bosonic operator, so if one wants to represent the boson number
7 | operator it should do for example:
8 |
9 | .. code-block:: python
10 |
11 | from qiskit_nature.second_q.operators import BosonicOp
12 | bosonic_op = BosonicOp({'+_0 -_0': 1}, num_modes=1)
13 |
14 | Due to the nature of bosonic particles, this class uses the commutator relations instead of the
15 | anti-commutator ones (used by fermionic particles).
16 |
17 | - |
18 | In order to use the bosonic operator for quantum applications, this feature also introduces the
19 | bosonic linear mapper, which allows to map the BosonicOp to the qubit space. This mapper is based
20 | on `this paper `_.
21 | To use this mapper one can for example:
22 |
23 | .. code-block:: python
24 |
25 | from qiskit_nature.second_q.mappers import BosonicLinearMapper
26 | mapper = BosonicLinearMapper(truncation=1)
27 | qubit_op = mapper.map(bos_op)
28 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/drop_python_3_7-35d42f30e19e7683.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | Support for running with Python 3.7 has been removed. To run Nature you need
5 | a minimum Python version of 3.8.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/faster-symmetry-unfolding-46d775eb5b2a4bf7.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The symmetry folding and unfolding routines listed below could become severe
5 | bottlenecks for larger system sizes. Now, when PySCF is installed, its routine will be
6 | used which is significantly faster.
7 |
8 | - :func:`.unfold_s4_to_s1`
9 | - :func:`.unfold_s8_to_s1`
10 | - :func:`.unfold_s8_to_s4`
11 | - :func:`.fold_s1_to_s4`
12 | - :func:`.fold_s1_to_s8`
13 | - :func:`.fold_s4_to_s8`
14 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/feat-polytensor-apply-multi-a3deea9586e6451a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new ``multi`` argument to the :meth:`.PolynomialTensor.apply` method which
5 | allows handling of numpy routines which return more than one array.
6 | The same argument also gets exposed by :meth:`.ElectronicIntegrals.apply`.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/feat-tensor-splitting-and-stacking-610c2de4f3353a1d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the following new utility methods for splitting and stacking multi-tensors:
5 |
6 | - :meth:`.PolynomialTensor.split`
7 | - :meth:`.PolynomialTensor.stack`
8 | - :meth:`.ElectronicIntegrals.split`
9 | - :meth:`.ElectronicIntegrals.stack`
10 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-active-space-integer-rounding-753ae77146610d9d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The :class:`.ActiveSpaceTransformer` would sometimes set the wrong number of active particles
5 | because of a flawed integer rounding. This has now been fixed.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-electronic-structure-result-printing-6e0b092097386c8f.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a formatting issue when printing an
5 | :class:`~qiskit_nature.second_q.problems.ElectronicStructureResult` which
6 | contains values in :attr:`~qiskit_nature.second_q.problems.ElectronicStructureResult.extracted_transformer_energies`
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-excited-states-tutorial-7eaf143d365b76c6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the tutorial for the excited state solvers.
5 | In doing so, the :class:`.EvaluationRule` is properly exposed for importing
6 | and documenting accordingly.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-fock-5bfbf630809a0570.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the computation of :meth:`.ElectronicEnergy.coulomb` (and by extension
5 | :meth:`.ElectronicEnergy.fock`) when applied to a purely alpha-spin Hamiltonian
6 | but providing a mixed spin density.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-freeze-core-transformer-with-charge-db3bd62005e9555c.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the behavior of the :class:`.FreezeCoreTransformer` when a charge is
5 | present on the molecule.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-from-polynomial-tensor-constant-9df7f63be4a4c819.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | When using :meth:`.SparseLabelOp.from_polynomial_tensor` constructor for one of
5 | :class:`.BosonicOp`, :class:`.FermionicOp`, :class:`.SpinOp`, or :class:`.VibrationalOp`, the
6 | coefficient for the constant term was a 0d Tensor object rather than a number. This has been
7 | fixed.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-hartree-fock-reference-energy-6c43c5fd68d83505.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The :attr:`.ElectronicStructureProblem.reference_energy` is now properly
5 | propagated to the :attr:`.ElectronicStructureResult.hartree_fock_energy`.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-interleaved-qubit-mapper-2877a7d00921911e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds the :meth:`.SparseLabelOp.from_terms` method which is the inverse of
5 | :meth:`.SparseLabelOp.terms`.
6 | - |
7 | Adds the :meth:`.SparseLabelOp.permute_indices` method which allows index
8 | permutations to be applied to an operator. For example:
9 |
10 | .. code-block:: python
11 |
12 | from qiskit_nature.second_q.operators import FermionicOp
13 |
14 | op = FermionicOp({"+_0 +_2 -_1 -_3": 1.0}, num_spin_orbitals=4)
15 |
16 | permuted_op = op.permute_indices([3, 1, 0, 2])
17 | print(permuted_op)
18 | # Fermionic Operator
19 | # number spin orbitals=4, number terms=1
20 | # 1.0 * ( +_3 +_0 -_1 -_2 )
21 |
22 | This is a very powerful method so caution is advised when using it as other
23 | components of the stack may rely on assumptions which are no longer valid
24 | after such a permutation (for example the builtin two-qubit reduction of the
25 | :class:`.ParityMapper`).
26 | fixes:
27 | - |
28 | Fixes the logic of the :class:`.InterleavedQubitMapper` to actually perform
29 | the interleaving on the second-quantization level rather than the qubit level.
30 | This ensures that the actually expected benefits from using an interleaved
31 | ordering (for example when mapping a paired double-excitation where all Z
32 | terms cancel each other) occur, rather than a naive re-shuffling of the
33 | already mapped qubit operator.
34 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-spin-op-to-matrix-e84594248fc49fd7.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the behavior of :meth:`.SpinOp.to_matrix` for operators acting on more
5 | than a single spin.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/fix-tensor-copying-a79c9cd626bd5563.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes the ``copy.copy`` and ``copy.deepcopy`` operations for the :class:`.Tensor` class.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/improve-register-length-handling-cb55f644da136828.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The :attr:`.SparseLabelOp.register_length` attribute (and by extension that of its subclasses, too)
5 | can no longer take ``None`` as its value. However, the attributes which this one might rely on
6 | (e.g. :attr:`.FermionicOp.num_spin_orbitals` or :attr:`.BosonicOp.num_modes`) can remain ``None``.
7 | This ensures that the lower-bound behavior works as intended.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/low-rank-linalg-86da86096d6122d8.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added linear algebra utilities for performing the double-factorization of a two-body tensor:
5 |
6 | - :func:`qiskit_nature.utils.double_factorized`
7 | - :func:`qiskit_nature.utils.modified_cholesky`
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/manual-unrestricted-spin-active-space-2462e3a9b8a10a10.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The ``active_orbitals`` argument of the :class:`.ActiveSpaceTransformer` may now also
5 | take a pair of lists of integers, each of which have a length identical to the number
6 | of active spatial orbitals. In this case, the first list indicates the alpha- and the
7 | second list the beta-spin orbital indices, respectively.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/puccsd-ansatz-7c97be6dca32a873.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new convenience subclass of the :class:`.UCC` ansatz. Namely, the
5 | spin-symmetry-adapted ansatz, :class:`.PUCCSD`, which includes single and double
6 | excitations while always pairing the excitations such that both, the number of
7 | particles and the total spin, will be preserved.
8 |
9 | You can use it like any of the other :class:`.UCC`-style ansätze, for example:
10 |
11 | .. code-block:: python
12 |
13 | from qiskit_nature.second_q.circuit.library import PUCCSD
14 | from qiskit_nature.second_q.mappers import JordanWignerMapper
15 |
16 | ansatz = PUCCSD(
17 | num_spatial_orbitals=4,
18 | num_particles=(2, 2),
19 | qubit_mapper=JordanWignerMapper(),
20 | )
21 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/qubit-mapper-performance-ef339b83f951e5a3.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixes a regression in the performance of the :meth:`~qiskit_nature.second_q.mappers.QubitMapper.map` method
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/sparse-3_11-1538988547ff6dd6.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Compatibility fix to support optional `sparse` install under Python 3.11.
5 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/support-pauli-sum-op-setting-in-ucc-43e33016b268cf19.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | Fixed the support of :attr:`~qiskit_nature.settings.use_pauli_sum_op` in the
5 | :class:`.UCC` and :class:`.UVCC` classes as well as their extensions.
6 | This requires version 0.24 or higher of the ``qiskit-terra`` package.
7 |
--------------------------------------------------------------------------------
/releasenotes/notes/0.7/ucc_imaginary-8d7d9c3322899a34.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added the new ``include_imaginary`` keyword argument to the
5 | :class:`~qiskit_nature.second_q.circuit.library.ansatzes.UCC`,
6 | :class:`~qiskit_nature.second_q.circuit.library.ansatzes.UCCSD`, and
7 | :class:`~qiskit_nature.second_q.circuit.library.ansatzes.PUCCD` classes.
8 | When ``True``, an extra ansatz parameter is added to each excitation that
9 | controls the imaginary contribution to its evolution. Thus, this setting
10 | doubles the total number of ansatz parameters, as compared to the default
11 | setting of ``False``.
12 |
--------------------------------------------------------------------------------
/releasenotes/notes/add-majoranaop-1cbf9d4a1d4c264e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new operator class, :class:`~qiskit_nature.second_q.operators.MajoranaOp`
5 | to handle operators that are sums of tensor products of Majorana fermion operators.
6 |
7 | Majorana operators use a string representation with underscore only, e.g. ``'_0 _1'``
8 | corresponds to :math:`\gamma_0 \gamma_1` where there are twice the number of spin orbitals
9 | operators satisfying :math:`\{\gamma_i,\gamma_j\} = 2 \delta_{ij}`.
10 |
11 | Methods of :class:`~qiskit_nature.second_q.operators.MajoranaOp` follow the same API as for
12 | :class:`~qiskit_nature.second_q.operators.FermionicOp` except for normal ordering, which is
13 | unnecessary. A Majorana operator can be created from a Fermionic operator using the
14 | :meth:`~qiskit_nature.second_q.operators.MajoranaOp.from_fermionic_op` class method. E.g.:
15 |
16 | .. code-block:: python
17 |
18 | from qiskit_nature.second_q.operators import FermionicOp, MajoranaOp
19 | f_op = FermionicOp({"+_0 -_1": 1}, num_spin_orbitals=2)
20 | m_op = MajoranaOp.from_fermionic_op(f_op)
21 |
--------------------------------------------------------------------------------
/releasenotes/notes/add-ternary-tree-mapper-dad9b02ae4af54d2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Adds a new mapper class, :class:`~qiskit_nature.second_q.mappers.TernaryTreeMapper`
5 | along with a new parent class :class:`~qiskit_nature.second_q.mappers.MajoranaMapper`
6 | implementing the Ternary Tree based mapping algorithm
7 | (cf. `arXiv:1910.10746 `_) that maps a `MajoranaOp`
8 | to a `SparsePauliOp`.
9 |
--------------------------------------------------------------------------------
/releasenotes/notes/bosonic-logarithmic-mapper-4b1f24c4ca16cf8b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | This release introduces a new mapper for the :class:`.BosonicOp`, the :class:`.BosonicLogarithmicMapper`.
5 | It is more efficient both in terms of the number of qubits required and, for some operations, in the number of Pauli strings generated due
6 | to the binary encoding of the bosonic operator. For other operations, such as the hopping term
7 | :math:`b^\dagger_i b_j`, the number of Pauli strings generated is bigger than the linear mapper.
8 | This mapper is based on this `paper `_.
9 | Below is an example of how one can use this mapper, assuming the existence of some :class:`.BosonicOp` instance called ``bos_op``:
10 |
11 | .. code-block:: python
12 |
13 | from qiskit_nature.second_q.mappers import BosonicLogarithmicMapper
14 | mapper = BosonicLogarithmicMapper(max_occupation=2)
15 | qubit_op = mapper.map(bos_op)
16 |
--------------------------------------------------------------------------------
/releasenotes/notes/drop_python_3_8-fd6fe0e7f9fbff49.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | upgrade:
3 | - |
4 | Support for running with Python 3.8 has been removed. To run Nature you need
5 | a minimum Python version of 3.9.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/fix-UCC-and-fully-occupied-MOs-c8fdf252a0607395.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Allow for building :class:`.UCC` ansatze for systems
5 | where at least one of the spin registers is not fully occupied.
6 |
--------------------------------------------------------------------------------
/releasenotes/notes/fix-angular-momentum-2-cebabde075b61a4e.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The :meth:`.AngularMomentum.overlap` property will now warn the user, when
5 | this matrix is non-unitary.
6 | fixes:
7 | - |
8 | Fixes the :class:`.AngularMomentum` operator further to also support cases
9 | where the number of beta-spin particles exceeds the number of alpha-spin
10 | particles.
11 |
--------------------------------------------------------------------------------
/releasenotes/notes/fix-angular-momentum-73eca0a5afb70679.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added the :func:`.get_overlap_ab_from_qcschema` function which extracts the
5 | alpha-beta spin orbital overlap matrix from a :class:`.QCSchema` instance.
6 | fixes:
7 | - |
8 | Fixes the following operators when dealing with non-orthonormal orbitals
9 | (for example when using unrestricted spin orbitals):
10 | - :class:`.AnglarMomentum`
11 | - :func:`.s_plus_operator`
12 | - :func:`.s_minus_operator`
13 | - :func:`.s_x_operator`
14 | - :func:`.s_y_operator`
15 |
16 | To make the fix take effect, the new additional `overlap` argument needs to
17 | be provided to all of these operators.
18 |
19 | Prior to this fix, none of the operators above were able to resolve any spin
20 | contamination and would yield misleadingly "clean" expectation values. See
21 | `this issue `_
22 | for a more complete discussion.
23 |
--------------------------------------------------------------------------------
/releasenotes/notes/fix-commutator-methods-fdae69426a05222a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | fixes:
3 | - |
4 | The commutator methods were faultily trying to call ``normal_order()`` on
5 | their operands, which are not guaranteed to have this method. Now, they no
6 | longer call this method and instead it is up to the user to normal-order the
7 | result as needed.
8 |
--------------------------------------------------------------------------------
/releasenotes/notes/improve-mappers-b55cb0ca5fd656e4.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | The class :class:`.second_q.mappers.ModeBasedMapper` has been added to implement mode based
5 | mapping via a Pauli table (previously part of :class:`.second_q.mappers.QubitMapper`).
6 | upgrade:
7 | - |
8 | :meth:`.ModeBasedMapper.pauli_table` is now an instance method of all :class:`.ModeBasedMapper`
9 | subclasses (previously a class method of :class:`.QubitMapper`)
10 | - |
11 | Methods ``.pauli_table``, ``.sparse_pauli_operators``, and ``.mode_based_mapping``
12 | have been removed from :class:`.QubitMapper`.
13 |
--------------------------------------------------------------------------------
/releasenotes/notes/py_3_12_support-ff91e3a300421b3d.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | features:
3 | - |
4 | Added support for using Qiskit Nature with Python 3.12.
5 |
--------------------------------------------------------------------------------
/requirements-dev.txt:
--------------------------------------------------------------------------------
1 | black[jupyter]~=24.1
2 | coverage>=4.4.0
3 | ddt>=1.2.0,!=1.4.0,!=1.4.3
4 | discover
5 | h5py
6 | jupyter-sphinx
7 | matplotlib>=3.3
8 | mypy>=0.991
9 | mypy-extensions>=0.4.3
10 | nbsphinx
11 | pylint>=2.15.0
12 | pylatexenc>=1.4
13 | qiskit-aer>=0.11.2
14 | qiskit-algorithms
15 | qiskit_sphinx_theme~=1.16.0
16 | reno>=3.4.0
17 | Sphinx>=5.0
18 | sphinx-design>=0.4.1
19 | sphinxcontrib-spelling!=7.3.1
20 | stestr>=2.0.0
21 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | qiskit>=0.44
2 | qiskit-algorithms>=0.2.1
3 | scipy>=1.4
4 | numpy>=1.17
5 | setuptools>=40.1.0
6 | h5py
7 | rustworkx>=0.12
8 |
--------------------------------------------------------------------------------
/test/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2018, 2024.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """ Qiskit Nature test packages """
14 |
15 | from .decorators import slow_test
16 | from .nature_test_case import QiskitNatureTestCase
17 |
18 | __all__ = ["QiskitNatureTestCase", "slow_test"]
19 |
--------------------------------------------------------------------------------
/test/decorators.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2017, 2024.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 |
14 | """Decorator for using with unit tests."""
15 |
16 | import functools
17 | import os
18 | import unittest
19 |
20 |
21 | def slow_test(func):
22 | """Decorator that signals that the test takes minutes to run.
23 |
24 | Args:
25 | func (callable): test function to be decorated.
26 |
27 | Returns:
28 | callable: the decorated function.
29 | """
30 |
31 | @functools.wraps(func)
32 | def _wrapper(*args, **kwargs):
33 | if "run_slow" in os.environ.get("QISKIT_TESTS", ""):
34 | raise unittest.SkipTest("Skipping slow tests")
35 | return func(*args, **kwargs)
36 |
37 | return _wrapper
38 |
--------------------------------------------------------------------------------
/test/second_q/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/algorithms/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/algorithms/excited_state_solvers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/algorithms/excited_state_solvers/resources/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/algorithms/ground_state_solvers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/algorithms/initial_points/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/circuit/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/circuit/library/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/circuit/library/ansatzes/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/circuit/library/ansatzes/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/circuit/library/initial_states/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/drivers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/drivers/gaussiand/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/drivers/gaussiand/test_driver_gaussian_from_mat.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/test/second_q/drivers/gaussiand/test_driver_gaussian_from_mat.mat
--------------------------------------------------------------------------------
/test/second_q/drivers/gaussiand/test_driver_gaussian_log_vibrational_energy.hdf5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/test/second_q/drivers/gaussiand/test_driver_gaussian_log_vibrational_energy.hdf5
--------------------------------------------------------------------------------
/test/second_q/drivers/psi4d/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/drivers/pyscfd/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/formats/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/formats/fcidump/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/formats/fcidump/test_fcidump_h2.fcidump:
--------------------------------------------------------------------------------
1 | &FCI NORB= 2,NELEC= 2,MS2= 0,
2 | ORBSYM=1,1,
3 | ISYM=0,
4 | /
5 | 6.7571015480351648E-01 1 1 1 1
6 | 6.6458173025529665E-01 1 1 2 2
7 | 1.8093119978423133E-01 1 2 1 2
8 | 6.9857372273201834E-01 2 2 2 2
9 | -1.2563390730032502E+00 1 1 0 0
10 | -2.3575299028703285E-16 1 2 0 0
11 | -4.7189600728114062E-01 2 2 0 0
12 | 7.1996899444897966E-01 0 0 0 0
13 |
--------------------------------------------------------------------------------
/test/second_q/formats/fcidump/test_fcidump_lih.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/test/second_q/formats/fcidump/test_fcidump_lih.npz
--------------------------------------------------------------------------------
/test/second_q/formats/fcidump/test_fcidump_oh.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/test/second_q/formats/fcidump/test_fcidump_oh.npz
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/he2_energy_VV10_input.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema_name": "qc_schema_input",
3 | "schema_version": 1,
4 | "molecule": {
5 | "schema_name": "qcschema_molecule",
6 | "schema_version": 2,
7 | "geometry": [
8 | 0,
9 | 0,
10 | 0,
11 | 0,
12 | 0,
13 | 6
14 | ],
15 | "symbols": [
16 | "He",
17 | "He"
18 | ]
19 | },
20 | "driver": "energy",
21 | "model": {
22 | "method": "VV10",
23 | "basis": "cc-pVDZ"
24 | },
25 | "keywords": {}
26 | }
27 |
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/he2_energy_VV10_input.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The expected He2 energy QCSchemaInput."""
14 | # pylint: disable=invalid-name
15 |
16 | from qiskit_nature.second_q.formats.qcschema import (
17 | QCModel,
18 | QCSchemaInput,
19 | QCTopology,
20 | )
21 |
22 | EXPECTED = QCSchemaInput(
23 | schema_name="qc_schema_input",
24 | schema_version=1,
25 | molecule=QCTopology(
26 | symbols=["He", "He"],
27 | geometry=[0, 0, 0, 0, 0, 6],
28 | schema_name="qcschema_molecule",
29 | schema_version=2,
30 | ),
31 | driver="energy",
32 | model=QCModel(
33 | method="VV10",
34 | basis="cc-pVDZ",
35 | ),
36 | keywords={},
37 | )
38 |
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/he2_energy_VV10_output.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema_name": "qc_schema_output",
3 | "schema_version": 1,
4 | "molecule": {
5 | "schema_name": "qcschema_molecule",
6 | "schema_version": 2,
7 | "geometry": [
8 | 0,
9 | 0,
10 | 0,
11 | 0,
12 | 0,
13 | 6
14 | ],
15 | "symbols": [
16 | "He",
17 | "He"
18 | ]
19 | },
20 | "driver": "energy",
21 | "model": {
22 | "method": "VV10",
23 | "basis": "cc-pVDZ"
24 | },
25 | "keywords": {},
26 | "provenance": {
27 | "creator": "QM Program",
28 | "version": "1.1",
29 | "routine": "module.json.run_json"
30 | },
31 | "return_result": -5.815121364568496,
32 | "success": true,
33 | "properties": {
34 | "calcinfo_nbasis": 10,
35 | "calcinfo_nmo": 10,
36 | "calcinfo_nalpha": 2,
37 | "calcinfo_nbeta": 2,
38 | "calcinfo_natom": 2,
39 | "return_energy": -5.815121364568496,
40 | "scf_one_electron_energy": -9.10156722786234,
41 | "scf_two_electron_energy": 4.782528510470115,
42 | "nuclear_repulsion_energy": 0.6666666666666666,
43 | "scf_dipole_moment": [
44 | 0.0,
45 | 0.0,
46 | 9.030096599360606e-14
47 | ],
48 | "scf_iterations": 3,
49 | "scf_total_energy": -5.815121364568496,
50 | "scf_vv10_energy": 0.018799951240226136,
51 | "scf_xc_energy": -2.181549265083163
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/legacy_electronic_structure_driver_result.hdf5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiskit-community/qiskit-nature/4cc927ce539219505defac61cd70ded081507361/test/second_q/formats/qcschema/legacy_electronic_structure_driver_result.hdf5
--------------------------------------------------------------------------------
/test/second_q/formats/qcschema/water_output_v3.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """The expected water output v3 QCSchema."""
14 |
15 | from copy import deepcopy
16 |
17 | from .water_output import EXPECTED
18 |
19 | EXPECTED = deepcopy(EXPECTED)
20 |
21 | EXPECTED.schema_version = 3
22 | EXPECTED.wavefunction.restricted = True
23 |
--------------------------------------------------------------------------------
/test/second_q/hamiltonians/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/hamiltonians/lattices/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/mappers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/mappers/resources/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/operators/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/problems/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/problems/resources/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/problems/test_eigenstate_result.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Tests for the EigenstateResult."""
14 |
15 | import unittest
16 | from test import QiskitNatureTestCase
17 |
18 | import numpy as np
19 |
20 | from qiskit_nature.second_q.problems import EigenstateResult
21 |
22 |
23 | class TestEigenstateResult(QiskitNatureTestCase):
24 | """Tests EigenstateResult"""
25 |
26 | def test_groundenergy(self):
27 | """Tests ground energy"""
28 | eigenstate_result = EigenstateResult()
29 | eigenstate_result.eigenvalues = np.array([1, 2, 3])
30 | self.assertEqual(eigenstate_result.groundenergy, 1)
31 |
32 |
33 | if __name__ == "__main__":
34 | unittest.main()
35 |
--------------------------------------------------------------------------------
/test/second_q/problems/test_lattice_properties_container.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Tests for the LatticePropertiesContainer."""
14 |
15 | import unittest
16 |
17 | from test import QiskitNatureTestCase
18 |
19 | from qiskit_nature.second_q.problems import LatticePropertiesContainer
20 | from qiskit_nature.second_q.properties import OccupiedModals
21 |
22 |
23 | class TestLatticePropertiesContainer(QiskitNatureTestCase):
24 | """Tests for the LatticePropertiesContainer."""
25 |
26 | def test_custom_property(self) -> None:
27 | """Tests support for custom property objects."""
28 | container = LatticePropertiesContainer()
29 | container.add(OccupiedModals([]))
30 | self.assertIn(OccupiedModals, container)
31 |
32 |
33 | if __name__ == "__main__":
34 | unittest.main()
35 |
--------------------------------------------------------------------------------
/test/second_q/properties/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2021, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/transformers/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/transformers/resources/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/second_q/utils.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2020, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
13 | """Some testing utilities."""
14 |
15 | from qiskit_nature.second_q.operators.symmetric_two_body import (
16 | S1Integrals,
17 | S4Integrals,
18 | S8Integrals,
19 | fold_s1_to_s4,
20 | fold_s1_to_s8,
21 | )
22 | from qiskit_nature.second_q.operators.tensor_ordering import _chem_to_phys
23 |
24 |
25 | def get_expected_two_body_ints(actual_ints, expected_ints):
26 | """Returns the ``expected_ints`` with the type of ``actual_ints``."""
27 | if isinstance(actual_ints, S1Integrals):
28 | return S1Integrals(expected_ints).to_dense()
29 | elif isinstance(actual_ints, S4Integrals):
30 | return fold_s1_to_s4(expected_ints, validate=False)
31 | elif isinstance(actual_ints, S8Integrals):
32 | return fold_s1_to_s8(expected_ints, validate=False)
33 | return _chem_to_phys(expected_ints)
34 |
--------------------------------------------------------------------------------
/test/testing/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------
/test/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # This code is part of a Qiskit project.
2 | #
3 | # (C) Copyright IBM 2022, 2023.
4 | #
5 | # This code is licensed under the Apache License, Version 2.0. You may
6 | # obtain a copy of this license in the LICENSE.txt file in the root directory
7 | # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Any modifications or derivative works of this code must retain this
10 | # copyright notice, and modified files need to carry a notice indicating
11 | # that they have been altered from the originals.
12 |
--------------------------------------------------------------------------------