-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from qiboteam/code-examples
Documentation: Edit and move some pages from `Getting started` to `Tutorials`
- Loading branch information
Showing
17 changed files
with
230 additions
and
234 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
.. _molecule-class: | ||
|
||
Molecule | ||
======== | ||
|
||
Qibochem provides the ``Molecule`` class to save various properties related to the molecular system, | ||
and to drive the classical quantum chemistry calculation to obtain the necessary quantities for any subsequent quantum compute calculations. | ||
|
||
.. autoclass:: qibochem.driver.molecule.Molecule | ||
:members: | ||
:member-order: bysource |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
============ | ||
Installation | ||
============ | ||
Installation instructions | ||
========================= | ||
|
||
Using pip install: | ||
Supported operating systems | ||
--------------------------- | ||
|
||
At the moment, Qibochem is only actively supported on Linux and MacOS systems. | ||
In principle, it should be possible to install and run Qibochem on Windows, but with the caveat that the PySCF driver for obtaining molecular integrals is not available on Windows systems. | ||
|
||
.. note:: | ||
Qibochem is supported for Python >= 3.9. | ||
|
||
.. | ||
TODO: update further when package released on pypi | ||
Installing from source | ||
---------------------- | ||
|
||
Using ``pip install``: | ||
|
||
.. code-block:: | ||
git clone https://github.com/qiboteam/qibochem.git | ||
cd qibochem | ||
pip install . | ||
Using poetry: | ||
Using ``poetry``: | ||
|
||
.. code-block:: | ||
git clone https://github.com/qiboteam/qibochem.git | ||
cd qibochem | ||
poetry install | ||
For larger simulations, it may be desirable to install `other backend drivers <https://qibo.science/qibo/stable/getting-started/backends.html/>`_ for Qibo as well. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Quick start | ||
----------- | ||
|
||
.. | ||
TODO: Add pip install when package on pypi | ||
Here is an example of building the UCCD ansatz with the H2 molecule to test your installation: | ||
|
||
.. testcode:: | ||
import numpy as np | ||
from qibo.models import VQE | ||
|
||
from qibochem.driver.molecule import Molecule | ||
from qibochem.ansatz.hf_reference import hf_circuit | ||
from qibochem.ansatz.ucc import ucc_circuit | ||
|
||
# Define the H2 molecule and obtain its 1-/2- electron integrals with PySCF | ||
h2 = Molecule([('H', (0.0, 0.0, 0.0)), ('H', (0.0, 0.0, 0.7))]) | ||
h2.run_pyscf() | ||
# Generate the molecular Hamiltonian | ||
hamiltonian = h2.hamiltonian() | ||
|
||
# Build a UCC circuit ansatz for running VQE | ||
circuit = hf_circuit(h2.nso, sum(h2.nelec)) | ||
circuit += ucc_circuit(h2.nso, [0, 1, 2, 3]) | ||
|
||
# Create and run the VQE, starting with random initial parameters | ||
vqe = VQE(circuit, hamiltonian) | ||
|
||
initial_parameters = np.random.uniform(0.0, 2*np.pi, 8) | ||
best, params, extra = vqe.minimize(initial_parameters) | ||
|
||
|
||
.. | ||
TODO: Another example with measurements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.