Skip to content

Commit

Permalink
Merge branch 'v4' into add-connection-strategy-parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquessV committed Jul 7, 2023
2 parents b004ca0 + 1aacd38 commit c91f56a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 8 deletions.
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# Changelog

## 4.0.0-rc.28

### Breaking Changes

- The `QuantumComputer`'s `run` method now takes an optional `MemoryMap` parameter. This mapping takes memory region names to a list of values to use for a run. This replaces the need to use `write_memory` on `Program`s between runs.
- use qcs-sdk-python implementation of conjugate_pauli_by_clifford and generate_randomized_benchmarking_sequence (#1557)
- remove qcs-api-client dependency (#1550)
- Removes the compatilbility.v2 subpackage

### Features

- increase gRPC message size limit (#1610)
- support translation options for QPUCompiler (#1590)
- remove v2 compatibility layer (#1475)
- gracefully handle error when QPU unavailable for engagement (#1457)

### Fixes

- `Program.copy_everything_except_instructions()` no longer adds declarations to the instructions property (#1612)
- specify `quil` as a dependency
- `copy_everything_but_instructions` now correctly copies `DECLARE` statements (#1600)
- get_qc will use the given client_configuration
- Remove calibrations from program before sending them to a QVM (#1592)
- Replace `retry`, loosen `networkx` requirements, ensure adding programs don't mutate the first
- Parametric DefGates and upper case function call expressions will no longer fail to parse. (#1589)
- native_quil_to_executable will no longer block indefinitely (#1585)
- The default QCSClient will now load without having QCS credentials (#1582)
- bump qcs-sdk-python to fix waveforms (#1507)
- Remove pyi type annotations causing runtime errors (#1506)
- use highest priority Gateway (#1504)
- use properly packaged qcs-sdk types
- Docs Theme
- Docker qvm/quilc in `rigetti/forest` image. (#1437)
- DefFrame to/from Quil with JSON values (#1419)
- DefFrame to/from Quil with JSON values (#1419)
- Correctly apply the phase in quilwaveforms (#1408)
- allow spaces in DEFFRAME specs
- Correctly apply the phase in quilwaveforms (#1408)
- Changed pad_left to pad_right
- allow spaces in DEFFRAME specs
- Changed pad_left to pad_right
- update Quil-T docs to use `get_calibration_program()` name (#1389)
- allow np.ndarray in write_memory and disallow non-int and non-fl… (#1365)
- document error on noisy qcs qpu request
- Fix bug in QPU workflow
- Fix execution of parametric programs (#1353)
- sphinx>=3.0.0,<4.0.0
- support instructions with no qubits or parameters
- remove extraneous debug prints
- Remove test RPCQ server to improve CI consistency. (#1350)
- lock port test fixture
- provide default client configuration on get qcs qpu (#1333)
- raise error on noisy qcs qpu (#1332)
- ignore node modules and commit npm lock
- Fix contiguous engagement handling (#1325)
- Re-add `QPUCompiler.refresh_calibration_program()` (#1323)
- add git commit messge check (#1318)
- include dead attributes when no gates present (#1317)
- Fix RC publising to PyPI
- GitHub checks for PRs to rc branch

## 4.0.0-rc.27

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyquil"
version = "4.0.0-rc.27"
version = "4.0.0-rc.28"
description = "A Python library for creating Quantum Instruction Language (Quil) programs."
authors = ["Rigetti Computing <[email protected]>"]
readme = "README.md"
Expand Down
3 changes: 1 addition & 2 deletions pyquil/api/_rewrite_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def expr_mref(expr: object) -> MemoryReference:
# so we divide by 8...
expr = str(Div(inst.scale, 8))
updated.inst(SetScale(inst.frame, expr_mref(expr)))
# Program.copy_everything_except_instructions persists DECLARE statements
elif not isinstance(inst, Declare):
else:
updated.inst(inst)

if mref_idx > 0:
Expand Down
6 changes: 2 additions & 4 deletions pyquil/quil.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ def copy_everything_except_instructions(self) -> "Program":
"""
new_prog = Program()
new_prog._calibrations = self.calibrations.copy()
for declaration in self.declarations.values():
new_prog.inst(declaration)
new_prog._declarations = self._declarations.copy()
new_prog._waveforms = self.waveforms.copy()
new_prog._defined_gates = self._defined_gates.copy()
new_prog._frames = self.frames.copy()
Expand All @@ -203,8 +200,9 @@ def copy(self) -> "Program":
:return: a new Program
"""
new_prog = self.copy_everything_except_instructions()
new_prog = self.copy_everything_except_instructions() # and declarations, which is a view
new_prog._instructions = self._instructions.copy()
new_prog._declarations = self._declarations.copy()
return new_prog

@property
Expand Down
4 changes: 3 additions & 1 deletion test/unit/test_quantum_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def test_qc_expectation_on_qvm(client_configuration: QCSClient, dummy_compiler:

def test_undeclared_memory_region(client_configuration: QCSClient, dummy_compiler: DummyCompiler):
"""
Fix for https://github.com/rigetti/pyquil/issues/1596
Test for https://github.com/rigetti/pyquil/issues/1596
"""
program = Program(
"""
Expand All @@ -847,6 +847,8 @@ def test_undeclared_memory_region(client_configuration: QCSClient, dummy_compile
"""
)
program = program.copy_everything_except_instructions()
assert len(program.instructions) == 0 # the purpose of copy_everything_except_instructions()
assert len(program.declarations) == 0 # this is a view on the instructions member; must be consistent
qc = QuantumComputer(name="testy!", qam=QVM(client_configuration=client_configuration), compiler=dummy_compiler)
executable = qc.compiler.native_quil_to_executable(program)
qc.run(executable)
Expand Down

0 comments on commit c91f56a

Please sign in to comment.