Skip to content

Commit

Permalink
fix: Update develop (#110)
Browse files Browse the repository at this point in the history
* Qermit 0.5.0 (#93)

* Uniform task labels (#36)

* Make _label case uniform

A VERY small PR making the case used for _label uniform.

* Capitalise Ex

* Pytket v1 upgrade (#41)

* Upgrade to pytket v1.0.1

This primarily includes:
- remove Rebase passes
- change module names

* Remove unused imports

* Add capitilisation

* Update docs with change to pytket version

* Correct version requirements

* Correct verson requirements

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>

* Remove Partial SPAM correcter (#42)

* remove all traces

* update docs

* Update build_and_test.yml

* Remove copy.copy (#43)

* update use of copy.copy in code

remove in many cases

* copy.deepcopy -> deepcopy

* reintroduce necessary copy

* fix typo

* Add ObservableTracker.clear method (#44)

* Shot splitter mitres (#40)

* Add shot splitting mitres

* Better python practice with shot splitting

* Correct comment format

* Change function name

* Add a compiled shot splitting metres

* Correct typing on split_index

* Use OutcomeArray to gather results

* Correct comment spelling

* Add splitting mitres to docs

* Rebuild docs

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>

* Remove appendix from LICENSE file (#46)

* Update graph visualisation (#37)

* update to vertical visualisation

* Update mitresgraph.png

* Delete mitresgraph.png

* update manual images

* update mitex manual images

* update docs image

* rebuild docs and manual

Co-authored-by: sjdilkes <[email protected]>

* Add basic "_cache" attribute for storing all generated edge data from run() (#47)

* add bad cache

* smarten how cache works

* qermit.mittask -> qermit.taskgraph

* add .cache to mitres and mitex

* remove redundant print

* add "run_basic" method (#48)

* Correct qubit mutation (#50)

* Add qubit relabelling task

* Correct typing

* Add documentation

* Add tests

* Code reformatting

* Correct manual

* Rebuild docs

* Add missing tasks to docs

Co-authored-by: Daniel Mills <[email protected]>

* Minor edits, rebuild docs and manual (#49)

* add bad cache

* smarten how cache works

* qermit.mittask -> qermit.taskgraph

* add .cache to mitres and mitex

* add "run_basic" method

* fix obvious issues

* qermit -> Qermit

* Update index.rst

* Update index.rst

* q -> Q

* rebuild manual and docs

* remove print

* rebuild docs and manual

* add "real" string back

* update docs

* update docs

* Update pytket version to 1~(#55)

* update pytket

* update

* Remove pytket from test requirements, and cast mean

* Update zne.py

* Remove use of RebaseToCliffordSingles

* BLACK FORMAT

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: sjdilkes <[email protected]>

* Add `characterisation` attribute to TaskGraph and pass as kwarg to TaskGraph.run  (#61)

* Update _version.py

* Update zne_test.py

* Add characterisation attribute to taskgraph

allow to be passed at run

* ignore numpy

* set mittask characterisation attribute when running

* Update frame_randomisation_test.py

* update pytket version

* Update frame_randomisation_test.py

* revert pytket changes

* update versioning

* Update SPAM correction to use characterisation instead of BackendInfo

* Update full_spam_test.py

* use characteriastoin in CCL

* update manual

* Add Spectral Filtering Method (#63)

* Initial commit with outline of protocol

* Remove unnecessary wires

* Add result extraction

* Output qpo

* Add test

* Add characterisation cache

* Add documentation

* Add spectral filtering tests

* Generalise tests to more complicated qpo

* Add type annotation

* Remove caches

* Add documentation

* Split FFT from formatting component

* Add tests for graph generation and new FFT and formating task

* Add tests, docs and type annotation for small coefficient filter

* Document FFT and related tasks

* Document SignalFilter

* Clean up some documentation

* Minor corrctions to typing

* Simplify NDArray typing

* Change to List type annotation

* Add additioinal documentation

* Address Silas PR comments

* Code Formatting

* Formatting and type checking

* Add compiled docs

* Compile manual

* Add spectral fiiltering to docs index

* Remove use of np array

* Correct typing

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>

* Update python version (#66)

* Update copyright (#69)

* Update pytket version to 1.11(#67)

* Change copyright

* Add noise scaling via 2 qubit gate folding (#72)

* Add 2 qubit gate folding

* Run black

* Import isclose

* Add test call to main call

---------

Co-authored-by: dan-mills-cqc <[email protected]>

* update docs

* Add failing tests (#76)

* Add failing SPAM test

* Add test backends

* Add pytket-quantinuum to test requirements

* Remove myqos imports

* Add test init

* Add failing ZNE test

* Add types and docs to mock backend

* Fix pytket-quantinuum test version

---------

Co-authored-by: dan-mills-cqc <[email protected]>
Co-authored-by: dan-mills-cqc <[email protected]>

* ZNE Include all Qubit Map (#78)

* add failing test

* Add complete workflow failing test

* Pass list of node maps

* Correct documentation

---------

Co-authored-by: dan-mills-cqc <[email protected]>

* Add removed wires in get_full_transition_tomography_circuits (#75)

* Add coverage for removing wires, also format

* Remove added DecomposeBoxes

* format

* Move MockQuantinuumBackend to qermit subdirectory, update FullyConneted architeture constructed

* remove pytest fails

* Update test_requirements.txt

* Update mock_quantinuum_backend.py

* Format code and add format check to CI (#77)

* Format code and add format check to CI

* Revert some formatting

* Add coverage to requirements

* Add flake8 to test requirements

* Install test requirements before running tests

* Update README with formatting change

* Correct formatting

---------

Co-authored-by: dan-mills-cqc <[email protected]>
Co-authored-by: dan-mills-cqc <[email protected]>

* Update versions

* Fix mock backend tests (#82)

* Extend mock mackend gateset

* Reduce optimisation level

* Remove unrequired changes

* Add n_cl_reg to mock quantinuum backend

* Change node names to match updates quaninuum backends

---------

Co-authored-by: dan-mills-cqc <[email protected]>
Co-authored-by: dan-mills-cqc <[email protected]>

* Make cache visible (#86)

* Make cache visible

* Add test for visible cache

---------

Co-authored-by: dan-mills-cqc <[email protected]>

* Use equivalence check between characterisation (#84)

I believe it's okay if they are not exactly the same list of nodes?

* correct duplication of experiment mitex (#85)

Co-authored-by: dan-mills-cqc <[email protected]>

* Docs/update docs theme (#90)

* add build and .venv to .gitignore

* update theme configuration in conf.py

* update theme requirements

* replace CQC logo with Quantinuum logo

* remove refernce to old logo in index.rst

* add built files to .gitignore

* update copyright

* update docs theme in user manual

* add source code links to API docs

* update old links in index

* remove redundant .gitignore line

* Add doc build to tests (#89)

Co-authored-by: dan-mills-cqc <[email protected]>

* Make Folding and Fit methods staticmethod (#87)

* Remove self

* Add @staticmethod decorator

* Repair high compute tests

---------

Co-authored-by: dan-mills-cqc <[email protected]>
Co-authored-by: dan-mills-cqc <[email protected]>

* Postselection and leakage example (#88)

* Add postselection and leakage example

* Add documentation

* add rst files

* Code formatting

* add reset and reorder compilation

* Add test comparing to pytket method

* remove post_select from manager

move to using one work postselect

* remove post_select from mitres

* Remove post_select from tests

* Silas corrections

* Correct formatting

---------

Co-authored-by: dan-mills-cqc <[email protected]>

* Separate NoisyAerBackend (#91)

* Sperate noisyaerbackend from mock quantinuum

* Correct mypy

* Add docstrings on gate sets

* Update test requirements

* Remove commented out gate set

* Correct code formatting

* Move noise model definition

* Correct gateset

---------

Co-authored-by: dan-mills-cqc <[email protected]>

* Reformat code with `black` (#92)

* Reformat black

* Add copyright notices

* Fix mypy issues

* appease CI

* Update versions

* Correct type annotatioin (#94)

* Correct type annotatioin

* Remove prints

* Additional typing corrections

* install testing requirements

* Correct workflow formatting

* Correct all type errors

* Minor code style changes

---------

Co-authored-by: dan-mills-cqc <[email protected]>

---------

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Silas Dilkes <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: sjdilkes <[email protected]>
Co-authored-by: cqc-melf <[email protected]>
Co-authored-by: CalMacCQ <[email protected]>

* Convert tests to floats

* Correct typing

* Ignore sympy when typing

---------

Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Silas Dilkes <[email protected]>
Co-authored-by: Daniel Mills <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: sjdilkes <[email protected]>
Co-authored-by: cqc-melf <[email protected]>
Co-authored-by: CalMacCQ <[email protected]>
  • Loading branch information
9 people authored Nov 18, 2024
1 parent 366eb1b commit 3ba1b88
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion qermit/clifford_noise_characterisation/cdr_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from copy import copy
import math
import warnings
from sympy.core.expr import Expr
from sympy.core.expr import Expr # type: ignore


class _BaseExCorrectModel(ABC):
Expand Down
2 changes: 1 addition & 1 deletion qermit/clifford_noise_characterisation/dfsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from typing import List, Tuple, cast, Union, Dict
from copy import copy
from sympy.core.expr import Expr
from sympy.core.expr import Expr # type: ignore

from qermit import (
MitEx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
random_clifford_circ,
)

from sympy.core.expr import Expr
from sympy.core.expr import Expr # type: ignore

from pytket.passes import RebaseTket, DecomposeBoxes # type: ignore
from pytket.utils import QubitPauliOperator, get_pauli_expectation_value
Expand Down
4 changes: 2 additions & 2 deletions qermit/zero_noise_extrapolation/zne.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from pytket.circuit import Node # type: ignore
from math import isclose
from pytket.pauli import Pauli
from sympy import Expr
from sympy import Expr # type: ignore
from qermit.noise_model import NoiseModel, PauliErrorTranspile
from pytket.utils.operators import CoeffTypeAccepted

Expand Down Expand Up @@ -616,7 +616,7 @@ def polynomial(x: List[float], y: List[float], _show_fit: bool, deg: int) -> flo
fit_x = linspace[0]
fit_y = linspace[1]

plot_fit(x, y, fit_x, fit_y, fit_to_zero)
plot_fit(x, y, list(fit_x), list(fit_y), fit_to_zero)

return float(fit_to_zero)

Expand Down
16 changes: 8 additions & 8 deletions tests/dfsc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ def test_DFSC_characterisation_task_gen():
# each characteriastion circuit should return some result
assert len(results) == 4
# assert each result is correct
assert results[0]._dict[qps0] == -1
assert results[1]._dict[qps1] == 1
assert results[2]._dict[qps0] == -1
assert results[3]._dict[qps1] == 1
assert results[0]._dict[qps0] == -1.0
assert results[1]._dict[qps1] == 1.0
assert results[2]._dict[qps0] == -1.0
assert results[3]._dict[qps1] == 1.0

test_task = DFSC_characterisation_task_gen()
assert test_task.n_in_wires == 2
Expand All @@ -243,10 +243,10 @@ def test_DFSC_characterisation_task_gen():
assert len(characterisation_results[0]) == 2

# check results are suitably recollated
assert characterisation_results[0][0]._dict[qps0] == -1
assert characterisation_results[0][0]._dict[qps1] == 1
assert characterisation_results[0][1]._dict[qps0] == -1
assert characterisation_results[0][1]._dict[qps1] == 1
assert characterisation_results[0][0]._dict[qps0] == -1.0
assert characterisation_results[0][0]._dict[qps1] == 1.0
assert characterisation_results[0][1]._dict[qps0] == -1.0
assert characterisation_results[0][1]._dict[qps1] == 1.0


def test_DFSC_correction_task_gen():
Expand Down
2 changes: 1 addition & 1 deletion tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_ObservableTracker_measurement_circuits_methods() -> None:
results = backend.get_results(handles)
final_qpo = test_ot.get_expectations(results)

assert final_qpo[qps_1] == 1
assert final_qpo[qps_1] == 1.0

with pytest.raises(ValueError):
test_ot.get_expectations([results[0]])
Expand Down

0 comments on commit 3ba1b88

Please sign in to comment.