Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Feb 21, 2024
1 parent bb8f4e4 commit e0de22f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Version 3.5 - xx February 2024

- Replaced ["CHANGES"] by
["CHANGES.md"](https://github.com/softwareQinc/staq/blob/main/CHANGES.md),
[CHANGES.md](https://github.com/softwareQinc/staq/blob/main/CHANGES.md),
- Removed pybind11 and GoogleTest dependencies; if not detected, they are
installed automatically as build dependencies by CMake
- Bumped GoogleTest version to HEAD latest, as
Expand Down
7 changes: 3 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ If you configured the system with `-DINSTALL_SOURCES=ON`, **staq**'s source
code will be installed in `/usr/local/include/staq` (UNIX/UNIX-like systems), or
in `C:\Program Files (x86)\staq` on Windows systems. The paths may differ on
your system. To use **staq**'s source code, precede all include paths by `staq`
in
your own code, i.e.,
in your own code, i.e.,

```c++
#include <staq/qasmtools/parser/parser.hpp>
Expand Down Expand Up @@ -165,8 +164,8 @@ followed by building the system as usual.

## Python 3 wrapper

[pystaq](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a Python 3
wrapper for **staq**. pystaq can be installed using `pip`
[**pystaq**](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a
Python 3 wrapper for **staq**. **pystaq** can be installed using `pip`

```shell
pip install git+https://github.com/softwareQinc/staq
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ documentation and detailed examples.

## Python 3 wrapper

[pystaq](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a Python 3
wrapper for **staq**. pystaq can be installed using `pip`
[**pystaq**](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a
Python 3 wrapper for **staq**. **pystaq** can be installed using `pip`

```shell
pip install git+https://github.com/softwareQinc/staq
Expand Down
7 changes: 4 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ docker run -p8889:8889 -it --workdir=/home/sq/notebooks softwareq-staq sh -c "ju

---

In case you want to use the Docker container as a development environment, mount
your directory (in this example the current directory) in a Docker container with
In case you want to use the Docker container as a development environment,
mount your directory (in this example the current directory) in a Docker
container with

```shell
docker run --rm -it --workdir=/home/sq/hostdir -v ${PWD}:/home/sq/hostdir softwareq-staq /bin/bash
docker run --rm -it --workdir=/home/sq/hostdir -v ${PWD}:/home/sq/hostdir softwareq-staq /bin/bash
```
33 changes: 21 additions & 12 deletions pystaq/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Installation instructions

[pystaq](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a Python 3
wrapper for **staq**. pystaq can be installed using `pip`
[**pystaq**](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a
Python 3 wrapper for **staq**. **pystaq** can be installed using `pip`

```
pip install git+https://github.com/softwareQinc/staq
```

## Creating python stubs for IDE autocompletion and static type checking

In case autocompletion (or static type checking via [mypy](https://www.mypy-lang.org/))
does not work properly in your editor/IDE, you may need to create python stubs
for the package. To do this, execute
In case autocompletion (or static type checking via
[mypy](https://www.mypy-lang.org/)) does not work properly in your editor/IDE,
you may need to create python stubs for the package. To do this, execute

```shell
mkdir ~/python_stubs
Expand All @@ -22,12 +22,14 @@ ln -s ~/python_stubs/pystaq.pyi ~/venv/lib/python3.11/site-packages
```

In the above, we assumed that your platform is UNIX/UNIX-like and that you have
pystaq installed in a virtual environment under `~/venv`. Please modify
**pystaq** installed in a virtual environment under `~/venv`. Please modify
accordingly on your system.

## Overview

To parse a circuit, use the function `pystaq.parse_file`, which takes a file path as input, or `pystaq.parse_str`, which accepts an OpenQASM 2.0 program string.
To parse a circuit, use the function `pystaq.parse_file`, which takes a file
path as input, or `pystaq.parse_str`, which accepts an OpenQASM 2.0 program
string.

The library provides the following tools:

Expand All @@ -50,7 +52,8 @@ qasm_synth
lattice_surgery
```

Each function takes as input a parsed program, followed by any options supported by the corresponding staq tool.
Each function takes as input a parsed program, followed by any options
supported by the corresponding staq tool.

---

Expand Down Expand Up @@ -90,7 +93,8 @@ cx q[0],q[1];

## Device generator

The `pystaq.Device` class can be used to create custom devices for mapping. It has the methods `add_edge` and `set_fidelity`.
The `pystaq.Device` class can be used to create custom devices for mapping. It
has the methods `add_edge` and `set_fidelity`.

---

Expand All @@ -106,7 +110,8 @@ with open('device.json', 'w') as f:
f.write(str(dev))
```

This produces the following `device.json` file, which can then be used by `pystaq.map`:
This produces the following `device.json` file, which can then be used by
`pystaq.map`:

```js
{
Expand Down Expand Up @@ -146,6 +151,10 @@ This produces the following `device.json` file, which can then be used by `pysta

## Custom Bindings

pystaq was created using pybind11. See [`pystaq/staq_wrapper.cpp`](https://github.com/softwareQinc/staq/blob/main/pystaq/staq_wrapper.cpp) for many examples of how to wrap a circuit transformation.
**pystaq** was created using [pybind11](https://github.com/pybind/pybind11).
See
[pystaq/staq_wrapper.cpp](https://github.com/softwareQinc/staq/blob/main/pystaq/staq_wrapper.cpp)
for many examples of how to wrap a circuit transformation.

For more details, see also our Quantum++ wrapper [pyqpp](https://github.com/softwareQinc/qpp/wiki/8.-pyqpp#custom-bindings).
For more details, see also our Quantum++ wrapper
[pyqpp](https://github.com/softwareQinc/qpp/wiki/8.-pyqpp#custom-bindings).

0 comments on commit e0de22f

Please sign in to comment.