Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation instructions #213

Merged
merged 41 commits into from
May 31, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c06b921
update-install
caleb-johnson May 28, 2023
b1e9c04
Improve installation instructions
caleb-johnson May 28, 2023
e4c1594
typo
caleb-johnson May 28, 2023
bb31614
Minor update
caleb-johnson May 28, 2023
ae22fd6
Minor update
caleb-johnson May 28, 2023
530bc51
Minor update
caleb-johnson May 28, 2023
4a16d52
Minor update
caleb-johnson May 28, 2023
93baf0a
Minor update
caleb-johnson May 28, 2023
023b91f
Minor update
caleb-johnson May 28, 2023
9744e1a
Minor update
caleb-johnson May 28, 2023
f4840c5
Minor update
caleb-johnson May 28, 2023
164e7a9
Minor update
caleb-johnson May 28, 2023
39e764c
Minor update
caleb-johnson May 28, 2023
5f01e34
Minor update
caleb-johnson May 28, 2023
de9a107
Add space before list
caleb-johnson May 28, 2023
3d88c9f
Add space before list
caleb-johnson May 28, 2023
b975d99
Add space before list
caleb-johnson May 28, 2023
23a0ad6
Minor update
caleb-johnson May 28, 2023
e78f1ea
Minor update
caleb-johnson May 28, 2023
01ebe4b
Minor update
caleb-johnson May 28, 2023
45940c2
Minor update
caleb-johnson May 28, 2023
726c0d7
Minor update
caleb-johnson May 28, 2023
65b575c
Minor update
caleb-johnson May 28, 2023
ad7e8dd
Minor update
caleb-johnson May 28, 2023
4d38496
Merge branch 'main' into update-install
caleb-johnson May 29, 2023
12e1b10
Minor change
caleb-johnson May 29, 2023
75bea58
Minor change
caleb-johnson May 29, 2023
19824cd
Update INSTALL.rst
caleb-johnson May 30, 2023
2472f2e
Update INSTALL.rst
caleb-johnson May 30, 2023
abf8467
Rework Install from Source section
caleb-johnson May 30, 2023
547ba03
Make some tweaks to Caleb's install PR (#223)
garrison May 30, 2023
ac84bd9
peer review
caleb-johnson May 30, 2023
a676aa8
Use powershell language syntax highlighting
garrison May 31, 2023
ad2bccc
Update INSTALL.rst
caleb-johnson May 31, 2023
8e6ba43
Update INSTALL.rst
caleb-johnson May 31, 2023
47a3f2c
Update INSTALL.rst
caleb-johnson May 31, 2023
f5aadd0
Update INSTALL.rst
caleb-johnson May 31, 2023
8bb5a6b
Move jupyter notebook section into Option 2
caleb-johnson May 31, 2023
80a2148
minor update
caleb-johnson May 31, 2023
16e3f7a
Update INSTALL.rst
caleb-johnson May 31, 2023
bdce8c9
Update INSTALL.rst
caleb-johnson May 31, 2023
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
158 changes: 125 additions & 33 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,51 +1,123 @@
#########################
Installation Instructions
#########################
=========================

There are two options: installing locally or using within a Docker
container.
Let's see how to install the Circuit Knitting Toolbox (CKT). The first
thing to do is choose how you're going to run and install the
packages. There are three primary ways to do this:

- If you are using Linux or macOS with an Intel chip (i.e., not the
new M1 or M2 chips), everything should work natively, so we
recommend the first option.
- All users on ARM chips, as well as all Windows users, will have to
use the toolbox within Docker (the second option) for all features to
work as designed.
- :ref:`Option 1`
- :ref:`Option 2`
- :ref:`Option 3`

Specifically, the following features are unavailable on the
aforementioned platforms:
CutQC and entanglement forging users should consult the
:ref:`Platform Support` section to determine which installation option
is appropriate for them. Users who wish to run within a
containerized environment may skip the pre-installation and move straight
to :ref:`Option 3`.

- The automatic wire cut search in the circuit cutting module
depends on cplex, which is only available on Intel chips and is not
yet available for Python 3.11.
- The entanglement forging notebooks require pyscf, which does not
support Windows.
.. note::

If a user wishes to use the circuit cutting toolbox to
automatically find optimized wire cuts for a circuit too large for
the free version of CPLEX, they should acquire a license and install
the `full
version <https://www.ibm.com/products/ilog-cplex-optimization-studio>`__.

Pre-Installation
^^^^^^^^^^^^^^^^

Users who wish to install locally (using either :ref:`Option 1` or :ref:`Option 2`) are encouraged to
follow a brief set of common instructions to prepare a Python environment for
installation of CKT:

First, create a minimal environment with only Python installed in it. We recommend using `Python virtual environments <https://docs.python.org/3.10/tutorial/venv.html>`__.

.. code:: sh
python3 -m venv /path/to/virtual/environment
Activate your new environment.

.. code:: sh
source /path/to/virtual/environment/bin/activate
Note: If you are using Windows, use the following commands in PowerShell:

.. code:: pwsh
python3 -m venv c:\path\to\virtual\environment
c:\path\to\virtual\environment\Scripts\Activate.ps1
.. _Option 1:

Option 1: Pip Installation
^^^^^^^^^^^^^^^^^^^^^^^^^^

Upgrade pip and install the CKT package.

.. code:: sh
pip install --upgrade pip
pip install circuit-knitting-toolbox
Users intending to use the entanglement forging tool should install the ``pyscf`` optional dependency.

Users intending to use the automatic cut finding functionality in the CutQC package should install the ``cplex`` optional dependency.

Adjust the options below to suit your needs.

Option 1: Local installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: sh
pip install 'circuit-knitting-toolbox[pyscf,cplex]'
.. _Option 2:

- **OPTIONAL** If a user wishes to use the circuit cutting tool to
automatically find optimized wire cuts for a circuit too large for
the free version of CPLEX, they should acquire a license and install
the `full
version <https://www.ibm.com/products/ilog-cplex-optimization-studio>`__.
Option 2: Install from Source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Enter a Python environment and install the software
Users who wish to develop in the repository or run the tutorials locally may want to install from source.

In either case, the first step is to clone the CKT repository.

.. code:: sh
git clone [email protected]:Qiskit-Extensions/circuit-knitting-toolbox.git
cd circuit-knitting-toolbox
python3 -m venv venv
source venv/bin/activate
Next, upgrade pip and enter the repository.

.. code:: sh
pip install --upgrade pip
pip install tox notebook -e '.[notebook-dependencies]'
cd circuit-knitting-toolbox
The next step is to install CKT to the virtual environment. If you plan on running the tutorials, install the
notebook dependencies in order to run all the visualizations in the notebooks.
If you plan on developing in the repository, you may want to install the ``dev`` dependencies.

Users intending to use the entanglement forging tool should install the ``pyscf`` optional dependency.

Users intending to use the automatic cut finding functionality in the CutQC package should install the ``cplex`` optional dependency.

Adjust the options below to suit your needs.

.. code:: sh
pip install tox notebook -e '.[notebook-dependencies,dev,pyscf,cplex]'
If you installed the notebook dependencies, you can get started with CKT by running the notebooks in the docs.

.. code::
cd docs/
jupyter notebook
- Navigate to the notebooks in the ``docs/tutorials/`` directory to run the
tutorials.
Option 2: Use within Docker
.. _Option 3:

Option 3: Use within Docker
^^^^^^^^^^^^^^^^^^^^^^^^^^^

We have provided a `Dockerfile <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/Dockerfile>`__, which can be used to
Expand Down Expand Up @@ -90,8 +162,28 @@ Once the container is running, you should see a message like this:

Locate the *last* URL in your terminal (the one that includes
``127.0.0.1``), and navigate to that URL in a web browser to access the
Jupyter notebook interface.
Jupyter Notebook interface.

The home directory includes a subdirectory named ``persistent-volume``.
All work you’d like to save should be placed in this directory, as it is
the only one that will be saved across different container runs.


.. _Platform Support:

Platform Support
^^^^^^^^^^^^^^^^

Users of Mac M1 or M2 chips and Windows users may have issues running certain components of CKT.

If you are using Linux or macOS with an Intel chip (i.e., not the
new M1 or M2 chips), everything should work natively, so we
recommend either :ref:`Option 1` or :ref:`Option 2`.

All users on ARM chips, as well as all Windows users, may have to
use the toolbox within Docker (:ref:`Option 3`), depending on what tools they intend to use.

- The automatic wire cut search in the ``cutqc`` package depends
on CPLEX, which is only available on Intel chips and is not yet available
for Python 3.11.
- The entanglement forging tool requires PySCF, which does not support Windows.