Skip to content

Commit

Permalink
Merge branch 'master' into 1691-libquil
Browse files Browse the repository at this point in the history
  • Loading branch information
notmgsk committed Jan 26, 2024
2 parents dc36af6 + a3295c3 commit 9103613
Show file tree
Hide file tree
Showing 18 changed files with 1,215 additions and 953 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
120 changes: 120 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,125 @@
# Changelog

## 4.5.0 (2024-01-24)

### Features

#### Add utility for filtering Programs and a method for removing Quil-T instructions (#1718)

### Fixes

#### Arithmetic instructions will not raise an error when used in Programs (#1723)

## 4.5.0-rc.0 (2024-01-18)

### Features

#### Add utility for filtering Programs and a method for removing Quil-T instructions (#1718)

### Fixes

#### Arithmetic instructions will not raise an error when used in Programs (#1723)

## 4.4.1-rc.0 (2024-01-16)

### Fixes

#### Arithmetic instructions will not raise an error when used in Programs (#1723)

## 4.4.0 (2023-12-15)

### Features

#### Add `get_attribute`, `set_attribute` `__getitem__` and `__setitem__` methods to `DefFrame` (#1714)

### Fixes

#### Relax numpy and scipy requirements (#1713)

#### DefFrame no longer attempts to serialize HARDWARE-OBJECT as json. (#1715)

#### Gate instructions specified as tuples no longer error when using a list of parameters. (#1716)

## 4.4.0-rc.1 (2023-12-15)

### Features

#### Add `get_attribute`, `set_attribute` `__getitem__` and `__setitem__` methods to `DefFrame` (#1714)

### Fixes

#### Relax numpy and scipy requirements (#1713)

#### DefFrame no longer attempts to serialize HARDWARE-OBJECT as json. (#1715)

#### Gate instructions specified as tuples no longer error when using a list of parameters. (#1716)

## 4.4.0-rc.0 (2023-12-15)

### Features

#### Add `get_attribute`, `set_attribute` `__getitem__` and `__setitem__` methods to `DefFrame` (#1714)

### Fixes

#### Relax numpy and scipy requirements (#1713)

#### DefFrame no longer attempts to serialize HARDWARE-OBJECT as json. (#1715)

## 4.3.1-rc.1 (2023-12-15)

### Fixes

#### Relax numpy and scipy requirements (#1713)

#### DefFrame no longer attempts to serialize HARDWARE-OBJECT as json. (#1715)

## 4.3.1-rc.0 (2023-12-14)

### Fixes

#### Relax numpy and scipy requirements (#1713)

## 4.3.0 (2023-12-08)

### Features

#### update qcs_sdk to add ability to modify TranslationOptions (#1706)

## 4.3.0-rc.1 (2023-12-08)

### Features

#### update qcs_sdk to add ability to modify TranslationOptions (#1706)

## 4.3.0-rc.0 (2023-12-06)

### Features

#### update qcs_sdk to add ability to modify TranslationOptions (#1706)

## 4.2.0 (2023-11-28)

### Features

#### Support Python 3.12 (#1696)

#### Final memory values are now available on QAMExecutionResults (#1703)

## 4.2.0-rc.1 (2023-11-28)

### Features

#### Support Python 3.12 (#1696)

#### Final memory values are now available on QAMExecutionResults (#1703)

## 4.2.0-rc.0 (2023-11-28)

### Features

#### Support Python 3.12 (#1696)

## 4.1.1 (2023-11-15)

### Fixes
Expand Down
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinxcontrib.jquery",
"nbsphinx",
"recommonmark",
]
Expand All @@ -53,6 +54,7 @@
pygments_style = "sphinx"
todo_include_todos = True
# intersphinx_mapping = { "python": ("https://docs.python.org/3/", None) }
autodoc_type_aliases = {"QPUCompilerAPIOptions": "pyquil.api._qpu_compiler.QPUCompilerAPIOptions"}

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down
15 changes: 10 additions & 5 deletions docs/source/introducing_v4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here is an example of how you might use a memory map in practice:
from pyquil.gates import RZ
from pyquil.quil import Program
qc = get_qc("Ankaa-1")
qc = get_qc("Ankaa-9Q-1")
program = Program()
theta = program.declare("theta", "REAL")
program += RZ(theta, 0)
Expand Down Expand Up @@ -50,7 +50,7 @@ In pyQuil v4, Gateway is enabled by default and it is generally recommended to k
from pyquil.api import get_qc, ExecutionOptionsBuilder, ConnectionStrategy
from pyquil.quil import Program
qc = get_qc("Ankaa-1")
qc = get_qc("Ankaa-9Q-1")
program = Program()
exe = qc.compile(program)
Expand Down Expand Up @@ -114,18 +114,23 @@ you should use the ``get_raw_readout_data`` method to access the raw data and bu
Using the new QPU Compiler Backend
----------------------------------

Rigetti's next-generation QPU compiler is accessible through pyQuil v4. This new backend is still in development, so while it will eventually become the default, it is currently in limited access. If you have access, you can configure your compiler to use it using the new ``QPUCompilerAPIOptions`` class:
Rigetti's next-generation QPU compiler is accessible through pyQuil v4. This backend is required for Ankaa-family QPUs and can be configured with the new :py:class:`~pyquil.api.QPUCompilerAPIOptions` class. This class
is a type alias of ``qcs-sdk-python``'s ``TranslationOptions``. See its `API documentation <https://github.com/rigetti/qcs-sdk-rust/blob/760df515ff9c88c1739fd69aeb00d8d38884345d/crates/python/qcs_sdk/qpu/translation.pyi#L139>`_ for more information on all the available parameters.

.. TODO: When qcs-sdk-python has live documentation, we should setup intersphinx so it can be linked to directly.
.. code:: python
from pyquil.api import get_qc, QPUCompilerAPIOptions
from pyquil.quil import Program
program = Program()
qc = get_qc("Ankaa-1")
qc = get_qc("Ankaa-9Q-1")
api_options = QPUCompilerAPIOptions()
api_options.use_backend_v2()
api_options.v2(
passive_reset_delay_seconds=0.0002
)
# Option 1: Apply to all compiled programs
qc.compiler.api_options = api_options
Expand Down
25 changes: 24 additions & 1 deletion docs/source/programs_and_gates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,31 @@ any other instruction:

...

.. _quil_t_qvm_warning:

.. warning::
`DELAY` and other Quil-T instructions aren't supported by the QVM.

``DELAY`` and other Quil-T instructions are not supported by the QVM or ``quilc``. If you want to test the validity
of a Quil-T containing program on a QVM you should remove all Quil-T instructions before running it. You can do this
dynamically by checking the ``qam`` property on your requested :py:class:`~pyquil.api.QuantumComputer`:

.. testcode:: remove-quil-t

from pyquil.quil import Program
from pyquil.gates import DELAY, H
from pyquil.api import QVM, get_qc

qc = get_qc("2q-qvm")
p = Program(H(0))
p += DELAY(0, 200e-9)

# If we're using a QVM, remove the Quil-T instructions
if isinstance(qc.qam, QVM):
p = p.remove_quil_t_instructions()
else: # Otherwise, compile to native Quil
p = qc.compiler.native_quil_to_executable(p)

qc.run(p)

.. warning::
In pyQuil v3 and below, it was common to specify a delay using ``PRAGMA DELAY``. This is no longer supported in v4 because it
Expand Down
6 changes: 6 additions & 0 deletions docs/source/quilt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ as determining `T1`. The hardware is almost at your fingertips.

For examples, see the adjacent notebooks. For more information, see
the `Quil project homepage <https://github.com/rigetti/quil>`_.

.. warning::

Quil-T instructions are not supported by `quilc` or the QVM. See
:ref:`this note <quil_t_qvm_warning>` for a pattern you can use to
dynamically remove them before testing your program against a QVM.
Loading

0 comments on commit 9103613

Please sign in to comment.