Installation¶
ffsim is supported directly on Linux and macOS.
ffsim is not supported directly on Windows. Windows users have two main options:
Use Windows Subsystem for Linux (WSL). WSL provides a Linux environment where ffsim can be pip installed from PyPI or from source.
Use ffsim within Docker. See Use within Docker.
Pip install¶
ffsim is available on PyPI. It can be installed by running
pip install ffsim
Install from source¶
Installing ffsim from source requires the following system dependencies:
A Rust compiler. See these instructions.
A BLAS implementation.
On macOS, ffsim uses the Accelerate framework that is included with the operating system, so no action is required.
On Linux, ffsim uses OpenBLAS. You may be able to install it using your system package manager:
Arch Linux:
sudo pacman -S blas-openblas
Fedora:
sudo dnf install openblas-devel
Ubuntu:
sudo apt install libopenblas-dev
Once these dependencies are satisfied, ffsim can be installed by cloning the repository and then using pip to install the package from source. For example:
git clone https://github.com/qiskit-community/ffsim.git
cd ffsim
pip install .
Use within Docker¶
We have provided a Dockerfile, which can be used to build a Docker image, as well as a compose.yaml file, which allows one to use the Docker image with just a few simple commands:
git clone https://github.com/qiskit-community/ffsim.git
cd ffsim
docker compose build
docker compose up
Depending on your system configuration, you may need to type sudo
before each docker
command.
Once the container is running, navigate to http://localhost:58888 in a web browser to access the 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.