Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Added
- NFT optimizer, part of a project of Qiskit Camp Asia 2019 (#729)
- Algorithm interface and result classes (#849)
- Chemistry FCIDump file driver (#859)
- Chemistry stack automatic Z2 symmetry reduction (#870)
- Ising Optimization: The 0-1 Knapsack problem (#878)
- Automatic Z2 symmetry reduction in the chemistry module (#870)
- Ising optimization: The 0-1 Knapsack problem (#878)
- VQE, VQC and QSVM accept `QuantumCircuit`s as variational forms/feature maps (#905)
- New `GSLS` (Gaussian Smoothing Line Search) optimizer for variational algorithms (#877)
- Qiskit optimization, an application stack for solving quadratic programs (#877)
- Qiskit's optimization module: a full toolset for solving quadratic programs (#877)
- QuadraticProblem: A class representing quadratic programs with quadratic and linear objective and constraints
- OptimizationAlgorithm: A base class for optimization algorithm
- OptimizationResult: A base class for optimization results
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Aqua includes domain application support for:
* [Machine Learning](#machine-learning)
* [Optimization](#optimization)

_**Note**: the Chemistry application stack was the first domain worked on. At the time of writing
_**Note**: the chemistry module was the first domain worked on. At the time of writing
the other domains have some logic in them but are not as fully realised. Future work is expected to
build out functionality in all application areas._

Expand Down Expand Up @@ -143,16 +143,16 @@ excited states and dipole moments of molecule, both open and closed-shell.
The code comprises chemistry drivers, which when provided with a molecular
configuration will return one and two-body integrals as well as other data that is efficiently
computed classically. This output data from a driver can then be used as input to the chemistry
application stack that contains logic which is able to translate this into a form that is suitable
module that contains logic which is able to translate this into a form that is suitable
for quantum algorithms. The conversion first creates a FermionicOperator which must then be mapped,
e.g. by a Jordan Wigner mapping, to a qubit operator in readiness for the quantum computation.

### Optional Installs

To run chemistry experiments using Qiskit Chemistry, it is recommended that you to install a
classical computation chemistry software program/library interfaced by Qiskit Chemistry.
To run chemistry experiments using Qiskit's chemistry module, it is recommended that you to install
a classical computation chemistry software program/library interfaced by Qiskit.
Several, as listed below, are supported, and while logic to interface these programs is supplied by
Qiskit Chemistry via the above pip installation, the dependent programs/libraries themselves need
the chemistry module via the above pip installation, the dependent programs/libraries themselves need
to be installed separately.

Note: As `PySCF` can be installed via pip the installation of Qiskit (Aqua) will install PySCF
Expand All @@ -166,8 +166,8 @@ whether this might be possible manually.

### HDF5 Driver

A useful functionality integrated into Qiskit Chemistry is its ability to serialize a file in
Hierarchical Data Format 5 (HDF5) format representing all the output data from a chemistry driver.
A useful functionality integrated into Qiskit's chemistry module is its ability to serialize a file
in hierarchical Data Format 5 (HDF5) format representing all the output data from a chemistry driver.

The [HDF5 driver](qiskit/chemistry/drivers/hdf5d/hdf5driver.py#L25)
accepts such such HDF5 files as input so molecular experiments can be run, albeit on the fixed data
Expand All @@ -182,9 +182,9 @@ repository. This
[HDF5 Driver tutorial](https://github.com/Qiskit/qiskit-community-tutorials/blob/master/chemistry/hdf5_files_and_driver.ipynb)
contains further information about creating and using such HDF5 files.

### Creating Your First Qiskit Chemistry Programming Experiment
### Creating Your First Chemistry Programming Experiment in Qiskit

Now that Qiskit is installed, it's time to begin working with Chemistry.
Now that Qiskit is installed, it's time to begin working with the chemistry module.
Let's try a chemistry application experiment using VQE (Variational Quantum Eigensolver) algorithm
to compute the ground-state (minimum) energy of a molecule.

Expand Down Expand Up @@ -255,7 +255,7 @@ of the circuits. By passing in a backend as is done above it is internally wrapp

### Further examples

Jupyter notebooks containing further examples, for Qiskit Chemistry, may be found in the
Jupyter notebooks containing further chemistry examples may be found in the
following Qiskit GitHub repositories at
[qiskit-iqx-tutorials/qiskit/advanced/aqua/chemistry](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/aqua/chemistry)
and
Expand All @@ -269,9 +269,9 @@ The `qiskit.finance` package contains uncertainty components for stock/securitie
Ising translators for portfolio optimizations and data providers to source real or random data to
finance experiments.

### Creating Your First Qiskit Finance Programming Experiment
### Creating Your First Finance Programming Experiment in Qiskit

Now that Qiskit is installed, it's time to begin working with Finance.
Now that Qiskit is installed, it's time to begin working with the finance module.
Let's try a experiment using Amplitude Estimation algorithm to
evaluate a fixed income asset with uncertain interest rates.

Expand Down Expand Up @@ -305,7 +305,7 @@ When running the above the estimated value result should be 2.46 and probability

### Further examples

Jupyter notebooks containing further examples, for Qiskit Finance, may be found in the
Jupyter notebooks containing further finance examples may be found in the
following Qiskit GitHub repositories at
[qiskit-iqx-tutorials/qiskit/advanced/aqua/finance](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/aqua/finance)
and
Expand All @@ -320,7 +320,7 @@ classification algorithms such as QSVM and VQC (Variational Quantum Classifier),
can be used for experiments, and there is also QGAN (Quantum Generative Adversarial Network)
algorithm.

### Creating Your First Qiskit Machine Learning Programming Experiment
### Creating Your First Machine Learning Programming Experiment in Qiskit

Now that Qiskit is installed, it's time to begin working with Machine Learning.
Let's try a experiment using VQC (Variational Quantum Classified) algorithm to
Expand Down Expand Up @@ -359,7 +359,7 @@ print('Testing accuracy: {:0.2f}'.format(result['testing_accuracy']))

### Further examples

Jupyter notebooks containing further examples, for Qiskit Machine Learning, may be found in the
Jupyter notebooks containing further Machine Learning examples may be found in the
following Qiskit GitHub repositories at
[qiskit-iqx-tutorials/qiskit/advanced/aqua/machine_learning](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/aqua/machine_learning)
and
Expand All @@ -376,9 +376,9 @@ as Max-Cut, Traveling Salesman and Vehicle Routing. It also has a has an automat
generator for a problem model specified by the user as a model in
[docplex](qiskit/optimization/ising/docplex.py#L16).

### Creating Your First Qiskit Optimization Programming Experiment
### Creating Your First Optimization Programming Experiment in Qiskit

Now that Qiskit is installed, it's time to begin working with Optimization.
Now that Qiskit is installed, it's time to begin working with the optimization module.
Let's try a optimization experiment using QAOA (Quantum Approximate Optimization Algorithm)
to compute the solution of a [Max-Cut](https://en.wikipedia.org/wiki/Maximum_cut) problem using
a docplex model to create the Ising Hamiltonian operator for QAOA.
Expand Down Expand Up @@ -438,7 +438,7 @@ print('solution objective:', max_cut.max_cut_value(x, w))

### Further examples

Jupyter notebooks containing further examples, for Qiskit Optimization, may be found in the
Jupyter notebooks containing further examples, for the optimization module, may be found in the
following Qiskit GitHub repositories at
[qiskit-iqx-tutorials/qiskit/advanced/aqua/optimization](https://github.com/Qiskit/qiskit-iqx-tutorials/tree/master/qiskit/advanced/aqua/optimization)
and
Expand Down
31 changes: 16 additions & 15 deletions qiskit/chemistry/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Qiskit Chemistry
# Chemistry In Qiskit

Qiskit Chemistry is a set of tools, algorithms and software for use with quantum computers
Qiskit's chemistry module is a set of tools, algorithms and software for use with quantum computers
to carry out research and investigate how to take advantage of quantum computing power to solve chemistry
problems.

If you need introductory material see the main [readme](../../README.md) which has
[installation](../../README.md#installation) instructions and information on how to use Qiskit Chemistry for
[installation](../../README.md#installation) instructions and information on how to use the
chemisty module for
[running a chemistry experiment](../../README.md#running-a-chemistry-experiment).

This readme contains the following sections:
This readme contains the following sections:

* [Developers](#developers)
* [Additional reading](#additional-reading)
Expand All @@ -29,32 +30,32 @@ The dictionary contains the following fields of note:
* *energies*

An array of energies comprising the ground state energy and any excited states if they were computed

* *nuclear_repulsion_energy*

The nuclear repulsion energy
The nuclear repulsion energy

* *hf_energy*

The Hartree-Fock ground state energy as computed by the driver

* *nuclear_dipole_moment*, *electronic_dipole_moment*, *dipole_moment*

Nuclear, electronic and combined dipole moments for x, y and z

* *total_dipole_moment*

Total dipole moment
* *algorithm_retvals*
Total dipole moment

* *algorithm_retvals*

The result dictionary of the algorithm that ran for the above values. See the algorithm for any further information.
The result dictionary of the algorithm that ran for the above values. See the algorithm for any further information.

### For writers of algorithms and other utilities such as optimizers and variational forms:

Qiskit Aqua is the library of cross-domain algorithms and utilities. Please refer to the documentation
Qiskit Aqua is the library of cross-domain algorithms and utilities. Please refer to the documentation
there for more information on how to write and contribute such objects to Qiskit Aqua. Such objects are then available
to be used by Qiskit Chemistry.
to be used by Qiskit's chemistry module.

### For unit test writers:

Expand Down
13 changes: 7 additions & 6 deletions qiskit/chemistry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
r"""
==============================================================
Chemistry application stack for Aqua (:mod:`qiskit.chemistry`)
==============================================================
===================================================
Qiskit's chemistry module (:mod:`qiskit.chemistry`)
===================================================

.. currentmodule:: qiskit.chemistry

This is the chemistry application stack for Aqua that provides for experimentation with chemistry
This is Qiskit's chemistry module that provides for experimentation with chemistry
domain problems such as ground state energy and excited state energies of molecules.

Overview
========

This is an overview of the workings of the chemistry stack and how it may be used. There
This is an overview of the workings of the chemistry module and how it may be used. There
are different levels of exposure to its functionality, allowing for experimentation at different
abstractions. The outline below starts with the flow that provides the most control of the
process.
Expand Down Expand Up @@ -78,7 +78,8 @@

Mappings
++++++++
To map the FermionicOperator to a qubit operator Qiskit Chemistry supports the following mappings:
To map the FermionicOperator to a qubit operator the chemistry module supports the following
mappings:

Jordan Wigner
The `Jordan-Wigner transformation <https://rd.springer.com/article/10.1007%2FBF01331938>`__,
Expand Down
6 changes: 2 additions & 4 deletions qiskit/chemistry/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@


def get_qiskit_chemistry_logging() -> int:
"""
Returns the current Qiskit Chemistry logging level
"""Returns the current Qiskit chemistry logging level

Returns:
int: logging level
Expand All @@ -31,8 +30,7 @@ def get_qiskit_chemistry_logging() -> int:


def set_qiskit_chemistry_logging(level: int, filepath: Optional[str] = None) -> None:
"""
Updates the Qiskit Chemistry logging with the appropriate logging level
"""Updates the Qiskit chemistry logging with the appropriate logging level

Args:
level: minimum severity of the messages that are displayed.
Expand Down
18 changes: 9 additions & 9 deletions qiskit/chemistry/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
=========================================================
.. currentmodule:: qiskit.chemistry.drivers

Qiskit Chemistry requires a computational chemistry program or library, accessed via a chemistry
*driver*, to be installed on the system for the electronic-structure computation of a given
molecule. A driver is created with a molecular configuration, passed in the format compatible with
that particular driver. This allows custom configuration specific to each computational chemistry
program or library to be passed.
Qiskit's chemistry module requires a computational chemistry program or library, accessed via a
chemistry *driver*, to be installed on the system for the electronic-structure computation of a
given molecule. A driver is created with a molecular configuration, passed in the format compatible
with that particular driver. This allows custom configuration specific to each computational
chemistry program or library to be passed.

Qiskit Chemistry thus allows the user to configure a chemistry problem in a way that a chemist
The chemistry module thus allows the user to configure a chemistry problem in a way that a chemist
already using the underlying chemistry program or library will be familiar with. The driver is
used to compute some intermediate data, which later will be used to form the input to an Aqua
algorithm. Such intermediate data, is populated into a :class:`~qiskit.chemistry.QMolecule`
Expand All @@ -39,8 +39,8 @@
used to compute it. However the values and level of accuracy of such data will depend on the
underlying chemistry program or library used by the specific driver.

Qiskit Chemistry offers the option to serialize the Qmolecule data in a binary format known as
`Hierarchical Data Format 5 (HDF5) <https://support.hdfgroup.org/HDF5/>`__.
Qiskit's chemistry module offers the option to serialize the Qmolecule data in a binary format known
as `Hierarchical Data Format 5 (HDF5) <https://support.hdfgroup.org/HDF5/>`__.
This is done to allow chemists to reuse the same input data in the future and to enable researchers
to exchange input data with each other --- which is especially useful to researchers who may not
have particular computational chemistry drivers installed on their computers.
Expand Down Expand Up @@ -68,7 +68,7 @@

Drivers
=======
Qiskit Chemistry drivers obtain their information from classical ab-initio programs
The drivers in the chemistry module obtain their information from classical ab-initio programs
or libraries. Several drivers, interfacing to common programs and libraries, are
available. To use the driver its dependent program/library must be installed. See
the relevant installation instructions below for your program/library that you intend
Expand Down
2 changes: 1 addition & 1 deletion qiskit/chemistry/drivers/_basedriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HFMethodType(Enum):

class BaseDriver(ABC):
"""
Base class for Qiskit Chemistry Drivers.
Base class for Qiskit's chemistry drivers.
"""

@abstractmethod
Expand Down
18 changes: 9 additions & 9 deletions qiskit/chemistry/drivers/gaussiand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand All @@ -26,7 +26,7 @@
`Gaussian product installation support <http://gaussian.com/techsupport/#install]>`__.

Following the installation make sure the Gaussian™ 16 executable, `g16`, can be run from the
command line environment where you will be running Python and Qiskit Chemistry. For example
command line environment where you will be running Python and Qiskit. For example
verifying that the `g16` executable is reachable via the system environment path,
and appropriate exports, such as `GAUSS_EXEDIR`, have been configured as per
`Gaussian product installation support <http://gaussian.com/techsupport/#install]>`__.
Expand All @@ -36,27 +36,27 @@


In the :mod:`gauopen` folder the Python part of the above interfacing code,
as needed by Qiskit Chemistry, has been made available. It is licensed under a
as needed by Qiskit's chemistry modules, has been made available. It is licensed under a
`Gaussian Open-Source Public License
<https://github.com/Qiskit/qiskit-aqua/blob/master/qiskit/chemistry/drivers/gaussiand/gauopen/LICENSE.txt>`_.

Part of this interfacing code --- specifically, the Fortran file `qcmatrixio.F` --- requires
compilation to a Python native extension. However, Qiskit Chemistry comes with pre-built binaries
compilation to a Python native extension. However, Qiskit comes with pre-built binaries
for most common platforms. If there is no pre-built binary matching your platform, then it will be
necessary to compile this file as per the instructions below.

Compiling the Fortran Interfacing Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If no prebuilt native extension binary, as supplied with Qiskit Chemistry, works for your
If no prebuilt native extension binary, as supplied with Qiskit, works for your
platform, then to use the Gaussian™ 16 driver on your machine, the Fortran file `qcmatrixio.F`
must be compiled into object code that can be used by Python. This is accomplished using the
`Fortran to Python Interface Generator (F2PY) <https://docs.scipy.org/doc/numpy/f2py/>`__,
which is part of the `NumPy <http://www.numpy.org/>`__ Python library.
Specifically, on your command prompt window, change directory to the
`qiskit/chemistry/drivers/gaussiand/gauopen` directory inside the Qiskit Chemistry
installation directory, and while in the Python environment created for Aqua and Qiskit Chemistry,
invoke `f2py` on `qcmatrixio.F` as explained below.
`qiskit/chemistry/drivers/gaussiand/gauopen` directory inside the Qiskit
installation directory, and while in the Python environment created for Aqua and the chemistry
module, invoke `f2py` on `qcmatrixio.F` as explained below.


Apple macOS and Linux
Expand Down Expand Up @@ -93,7 +93,7 @@
and that `~/.gaussian` is the full path to
the selected scratch folder, where Gaussian™ 16 stores its temporary files.

Now, before Qiskit Chemistry can properly interface Gaussian™ 16, you will have to run the
Now, before Qiskit can properly interface Gaussian™ 16, you will have to run the
`enable_gaussian` command defined above. This, however, may generate the following error:

.. code:: sh
Expand Down
Loading