Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion .github/workflows/ci_build_library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Build the library on different platforms and run tests
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Build Python wheels and verify them
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_docker_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Build Docker images and test them
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_format_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Check source code with linters and formatters
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_hardware_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Test with instruction set extensions and parallelism
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_sanitizer_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Test with address and memory sanitizers
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_tcmalloc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-name: Test with TCMalloc (thread-caching malloc)
on:
push:
branches:
- master
- main

pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/osv-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ on:
types: [opened, synchronize]
branches:
- main
- master

# Support merge queues.
merge_group:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scorecard-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ on:
types: [opened, synchronize]
branches:
- main
- master

# Support merge queues.
merge_group:
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ vol. 574](https://www.nature.com/articles/s41586-019-1666-5), 2019).
### C++ usage

The code is basically designed as a library. The user can modify sample
applications in [apps](https://github.com/quantumlib/qsim/tree/master/apps)
applications in [apps](https://github.com/quantumlib/qsim/tree/main/apps)
to meet their own needs. The usage of sample applications is described in the
[docs](https://github.com/quantumlib/qsim/blob/master/docs/usage.md).
[docs](https://github.com/quantumlib/qsim/blob/main/docs/usage.md).

### Python usage

Expand All @@ -78,7 +78,7 @@ conda install -c conda-forge qsimcirq
```

_Note_: The core qsim library (located in the source repository under the
[`lib/`](https://github.com/quantumlib/qsim/blob/master/lib) subdirectory) can
[`lib/`](https://github.com/quantumlib/qsim/blob/main/lib) subdirectory) can
be included directly in C++ programs without installing the Python interface.

### Cirq usage
Expand All @@ -87,31 +87,31 @@ be included directly in C++ programs without installing the Python interface.
invoking Noisy Intermediate-Scale Quantum (NISQ) circuits. Cirq can use qsim
as its simulation library. To get started with simulating Cirq circuits using
qsim, please refer to the
[tutorial](https://github.com/quantumlib/qsim/blob/master/docs/tutorials/qsimcirq.ipynb).
[tutorial](https://github.com/quantumlib/qsim/blob/main/docs/tutorials/qsimcirq.ipynb).

More detailed information about the qsim-Cirq API can be found in the
[docs](https://github.com/quantumlib/qsim/blob/master/docs/cirq_interface.md).
[docs](https://github.com/quantumlib/qsim/blob/main/docs/cirq_interface.md).

### Input format

> [!WARNING]
> This format is deprecated, and no longer actively maintained.

The circuit input format is described in the
[docs](https://github.com/quantumlib/qsim/blob/master/docs/input_format.md).
[docs](https://github.com/quantumlib/qsim/blob/main/docs/input_format.md).

### Sample circuits

A number of sample circuits are provided in
[circuits](https://github.com/quantumlib/qsim/tree/master/circuits).
[circuits](https://github.com/quantumlib/qsim/tree/main/circuits).

### Unit tests

Unit tests for C++ libraries use the
[GoogleTest](https://github.com/google/googletest) framework, and are located in
[tests](https://github.com/quantumlib/qsim/tree/master/tests). Python tests use
[tests](https://github.com/quantumlib/qsim/tree/main/tests). Python tests use
[pytest](https://docs.pytest.org/en/stable/), and are located in
[qsimcirq_tests](https://github.com/quantumlib/qsim/tree/master/qsimcirq_tests).
[qsimcirq_tests](https://github.com/quantumlib/qsim/tree/main/qsimcirq_tests).

To build and run all tests, run:

Expand Down
24 changes: 12 additions & 12 deletions check/format-incremental
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

################################################################################
# Based on the Cirq python-formatting script:
# https://github.com/quantumlib/Cirq/blob/master/check/format-incremental
# https://github.com/quantumlib/Cirq/blob/main/check/format-incremental
#
# Formats python files that have been modified.
#
Expand All @@ -22,14 +22,14 @@
#
# You can specify a base git revision to compare against (i.e. to use when
# determining whether or not a file is considered to have "changed"). For
# example, you can compare against 'origin/master' or 'HEAD~1'.
# example, you can compare against 'origin/main' or 'HEAD~1'.
#
# If you don't specify a base revision, the following defaults will be tried, in
# order, until one exists:
#
# 1. upstream/master
# 2. origin/master
# 3. master
# 1. upstream/main
# 2. origin/main
# 3. main
#
# If none exists, the script fails.
################################################################################
Expand Down Expand Up @@ -63,14 +63,14 @@ done
if (( only_changed == 1 )); then
# Figure out which branch to compare against.
if [ -z "${rev}" ]; then
if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
rev=upstream/master
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
rev=origin/master
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
rev=master
if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
rev=upstream/main
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
rev=origin/main
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
rev=main
else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
exit 1
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/_scripts/build_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

flags.DEFINE_string(
"code_url_prefix",
("https://github.com/quantumlib/qsim/tree/master/" "qsimcirq"),
("https://github.com/quantumlib/qsim/tree/main/" "qsimcirq"),
"The url prefix for links to code.",
)

Expand Down
4 changes: 2 additions & 2 deletions docs/cirq_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ directory.
make run-py-tests
```
This will run
[qsimcirq_test](https://github.com/quantumlib/qsim/blob/master/qsimcirq_tests/qsimcirq_test.py),
[qsimcirq_test](https://github.com/quantumlib/qsim/blob/main/qsimcirq_tests/qsimcirq_test.py),
which invokes qsim through the qsim-Cirq interface.

## Interface design and operations
Expand Down Expand Up @@ -79,7 +79,7 @@ average PC, or up to 40 qubits on high-performance VMs).
Options for the simulator, including number of threads and verbosity, can be
set with the `qsim_options` field, which accepts a `QSimOptions` object as
defined in
[qsim_simulator.py](https://github.com/quantumlib/qsim/blob/master/qsimcirq/qsim_simulator.py).
[qsim_simulator.py](https://github.com/quantumlib/qsim/blob/main/qsimcirq/qsim_simulator.py).
These options can also be passed as a {str: val} dict, using the format
described by that class.

Expand Down
2 changes: 1 addition & 1 deletion docs/input_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ time gate_name qubits parameters
Here `time` refers to when the gate is applied in the circuit. Gates with the same time can be
applied independently and they may be reordered for performance. Trailing
spaces or characters are not allowed. A number of sample circuits are provided
in [circuits](https://github.com/quantumlib/qsim/blob/master/circuits).
in [circuits](https://github.com/quantumlib/qsim/blob/main/circuits).

# Supported gates

Expand Down
6 changes: 3 additions & 3 deletions docs/install_qsimcirq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ For all others, Dockerfiles are provided to install qsim in a containerized
environment.

**Note:** The core qsim library (under
[lib/](https://github.com/quantumlib/qsim/blob/master/lib)) can be included
[lib/](https://github.com/quantumlib/qsim/blob/main/lib)) can be included
directly in C++ code without building and installing the qsimcirq interface.

## Before installation
Expand All @@ -14,12 +14,12 @@ Prior to installation, consider opening a
[virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).

Prerequisites are included in the
[`requirements.txt`](https://github.com/quantumlib/qsim/blob/master/requirements.txt)
[`requirements.txt`](https://github.com/quantumlib/qsim/blob/main/requirements.txt)
file, and will be automatically installed along with qsimcirq.

If you'd like to develop qsimcirq, a separate set of dependencies are includes
in the
[`dev-requirements.txt`](https://github.com/quantumlib/qsim/blob/master/dev-requirements.txt)
[`dev-requirements.txt`](https://github.com/quantumlib/qsim/blob/main/dev-requirements.txt)
file. You can install them with `pip3 install -r dev-requirements.txt` or
`pip3 install qsimcirq[dev]`.

Expand Down
4 changes: 2 additions & 2 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ of qsim in cross-entropy benchmarks

Integration with [Cirq](https://github.com/quantumlib/Cirq) makes getting
started with qsim easy! Check out the
[installation guide](https://github.com/quantumlib/qsim/blob/master/docs/install_qsimcirq.md)
[installation guide](https://github.com/quantumlib/qsim/blob/main/docs/install_qsimcirq.md)
or try the runnable
[notebook tutorial](https://github.com/quantumlib/qsim/blob/master/docs/tutorials/qsimcirq.ipynb).
[notebook tutorial](https://github.com/quantumlib/qsim/blob/main/docs/tutorials/qsimcirq.ipynb).

## Design

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/gcp_cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Instances dashboard to prevent further billing.

You are now ready to run your own large simulations on Google Cloud. If you want
to try a large circuit on Google Cloud, you can connect the
[Simulate a large quantum circuit](https://colab.sandbox.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/q32d14.ipynb)
[Simulate a large quantum circuit](https://colab.sandbox.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/q32d14.ipynb)
Colab notebook to your VM
([documentation](https://quantumai.google/qsim/tutorials/q32d14)).

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/noisy_qsimcirq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
" <a target=\"_blank\" href=\"https://quantumai.google/qsim/tutorials/noisy_qsimcirq\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/noisy_qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/noisy_qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://github.com/quantumlib/qsim/blob/master/docs/tutorials/noisy_qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
" <a target=\"_blank\" href=\"https://github.com/quantumlib/qsim/blob/main/docs/tutorials/noisy_qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://storage.googleapis.com/tensorflow_docs/qsim/docs/tutorials/noisy_qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/q32d14.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
" <a target=\"_blank\" href=\"https://quantumai.google/qsim/tutorials/q32d14\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/q32d14.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
" <a target=\\"_blank\\" href=\\"https://colab.research.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/q32d14.ipynb\\"><img src=\\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\\" />Run in Google Colab</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://github.com/quantumlib/qsim/blob/master/docs/tutorials/q32d14.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
" <a target=\\"_blank\\" href=\\"https://github.com/quantumlib/qsim/blob/main/docs/tutorials/q32d14.ipynb\\"><img src=\\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\\" />View source on GitHub</a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://storage.googleapis.com/tensorflow_docs/qsim/docs/tutorials/q32d14.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/qsimcirq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
" <a target=\"_blank\" href=\"https://quantumai.google/qsim/tutorials/qsimcirq\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
" <a target=\\"_blank\\" href=\\"https://colab.research.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/qsimcirq.ipynb\\"><img src=\\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\\" />Run in Google Colab</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://github.com/quantumlib/qsim/blob/master/docs/tutorials/qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
" <a target=\\"_blank\\" href=\\"https://github.com/quantumlib/qsim/blob/main/docs/tutorials/qsimcirq.ipynb\\"><img src=\\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\\" />View source on GitHub</a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://storage.googleapis.com/tensorflow_docs/qsim/docs/tutorials/qsimcirq.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
Expand Down Expand Up @@ -109,7 +109,7 @@
"id": "7lYC4qxpDKMN"
},
"source": [
"Simulating Cirq circuits with qsim is easy: just define the circuit as you normally would, then create a `QSimSimulator` to perform the simulation. This object implements Cirq's [simulator.py](https://github.com/quantumlib/Cirq/blob/master/cirq-core/cirq/sim/simulator.py) interfaces, so you can drop it in anywhere the basic Cirq simulator is used."
"Simulating Cirq circuits with qsim is easy: just define the circuit as you normally would, then create a `QSimSimulator` to perform the simulation. This object implements Cirq's [simulator.py](https://github.com/quantumlib/Cirq/blob/main/cirq-core/cirq/sim/simulator.py) interfaces, so you can drop it in anywhere the basic Cirq simulator is used."
]
},
{
Expand Down Expand Up @@ -354,7 +354,7 @@
"id": "OUjhKoRVZGKZ"
},
"source": [
"qsim performance can be tuned further by passing options to the simulator constructor. These options use the same format as the qsim_base binary - a full description can be found in the qsim [usage doc](https://github.com/quantumlib/qsim/blob/master/docs/usage.md). The example below demonstrates enabling multithreading in qsim; for best performance, use the same number of threads as the number of cores (or virtual cores) on your machine."
"qsim performance can be tuned further by passing options to the simulator constructor. These options use the same format as the qsim_base binary - a full description can be found in the qsim [usage doc](https://github.com/quantumlib/qsim/blob/main/docs/usage.md). The example below demonstrates enabling multithreading in qsim; for best performance, use the same number of threads as the number of cores (or virtual cores) on your machine."
]
},
{
Expand Down Expand Up @@ -441,7 +441,7 @@
"id": "KUAwCOGeu0wA"
},
"source": [
"In order to let qsimh know how we want to split up the circuit, we need to pass it some additional options. More detail on these can be found in the qsim [usage doc](https://github.com/quantumlib/qsim/blob/master/docs/usage.md), but the fundamentals are explained below."
"In order to let qsimh know how we want to split up the circuit, we need to pass it some additional options. More detail on these can be found in the qsim [usage doc](https://github.com/quantumlib/qsim/blob/main/docs/usage.md), but the fundamentals are explained below."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/qsimcirq_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ The container port is now forwarded to your local machine.
## Connect Colab to your local runtime

First, get a notebook up and running on Colab. Open the
<a target="_blank" class="external" href="https://colab.research.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/qsimcirq.ipynb">Get started with qsimcirq</a>
<a target="_blank" class="external" href="https://colab.research.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/qsimcirq.ipynb">Get started with qsimcirq</a>
notebook in Colab.

If you are connect to Colab with a notebook visible, you can click *Connect* to
Expand All @@ -175,7 +175,7 @@ You should now be able to run the cells in the notebook.

A large circuit is provided with 32 qubits and a depth of 14 gate operations.
Open the
<a target="_blank" class="external" href="https://colab.research.google.com/github/quantumlib/qsim/blob/master/docs/tutorials/q32d14.ipynb">Simulate large quantum circuit</a>
<a target="_blank" class="external" href="https://colab.research.google.com/github/quantumlib/qsim/blob/main/docs/tutorials/q32d14.ipynb">Simulate large quantum circuit</a>
notebook in Colab.

This large circuit will not succeed if you attempt to run the default runtime.
Expand Down
Loading
Loading