Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper function around simulator's cheat function #7

Closed
damiansteiger opened this issue Jan 15, 2017 · 1 comment
Closed

Helper function around simulator's cheat function #7

damiansteiger opened this issue Jan 15, 2017 · 1 comment
Assignees

Comments

@damiansteiger
Copy link
Contributor

The simulator back-end already has a cheat() function to access the wavefunction and hence it is possible to calculate expectation values when using the simulator back-end. But it would be nice to have a few helper functions to make it easier to use and also an example in the tutorials.

@damiansteiger damiansteiger self-assigned this Jan 15, 2017
@thomashaener
Copy link
Contributor

Now, there is Simulator.get_expectation_value, which addresses this issue.

WrathfulSpatula referenced this issue in vm6502q/ProjectQ Jan 27, 2019
* Adding Qrack simulator

* Simplifying QrackSimulator

* Debugging Qrack simulator

* Debugging QrackSimulator

* is_available for no-matrix gates

* Debugging cheat

* Debugging set_wavefunction

* Debugging mapper

* QUnit

* Debugging amplitude return type

* Working Qrack unit tests

* Addition gates

* Debugging Qrack math

* Qrack multiply and divide

* Mul/div is_availabledebugging

* Mul/div is_available debugging

* Setup options and docs

* Docs debugging and directory restructure

* Fixing Qrack path

* Debugging qracksim tests

* Support systems without OpenCL

* First of several required fixes to the python test code

* Support for non-OpenCL QUnit fallback

* All OpenCL Qrack pytests pass

* Removing pytest settings.json

* Skip tests if not --with-qracksimulator

* Testing Travis --with-qracksimulator

* Testing Travis --with-qracksimulator

* Moving Travis Qrack folder

* Coverage

* Coverage

* Coverage

* Coverage

* Coverage

* Flipping reversed amplitudes (bug was fixed in Qrack)

* Adding 'QFusion' intermediate gate fusion layer

* QUnit Cohere peer relationship, for Qrack PR

* Removing extraneous generated file from versioning

* \d read as invalid escape sequence

* \d read as invalid escape sequence

* 'Cohere' becomes 'Compose'

* Separating QrackSimulator files/directory

* Optional Qrack Simulator build supersedes default simulator

* Changing constant math tests

* Fixing CI directory

* Fixing CI directory

* Testing constant math CI failure (doesn't reproduce on local machine)

* Widening float equality tolerances, where reasonable

* Qrack skips time evolution tests

* Qrack skips unsupported operations tests

* Conditionally remove low_level_gates filter from test

* Remaining decomposition test failures skipped

* Pointing CI to repo directory

* CI and README for this fork

* Fixing new README links

* Fixing new links in README

* Pulling working Qrack simulator onto master of fork (#7)

* Passing 0 and 1 control qubit uni. ctrl. tests

* Temporary branch for Travis

* Temporary folder for Travis

* Uni. ctrl. base case should use mapped bit

* Passing uni. ctrl. test, but controls seem to be sorted

* Fixing Travis after merge

* Still test default simulator when Qrack is included

* Use default simulator for time evolution tests

* Use default simulator for QubitOperator tests

* Test decompositions with both C++ simulators (and remove Qrack repo branch from CI)

* Fixing decomps. pytest parameterization

* Adding to coverage for uniformly controlled gates

* Builds with double and float Qrack (testing double in CI)

* Fixing mem leak and alloc safety

* See comment about Qrack mult. carry

* Adding direct state prep. support from Qrack simulator

* StatePreparation coverage

* StatePreparation coverage

* Triggering coveralls

* StatePrep. check for zero or empty container

* StatePrep. coverage debugging

* Changing random engine in Qrack repo

* Pointing Travis to master branch of Qrack, after merge

* Removing QFusion layer

* set_wavefunction does not need to reallocate

* Reverting unnecessary changes in diff from debugging

* Reverting unnecessary changes in diff from debugging (#2)

* 1e-9 tolerance still needed for float accuracy in SimulaQron

* Fixing CI across forks
Takishima added a commit that referenced this issue Aug 8, 2022
* Add Azure Quantum backend template files

* Add implementation of Azure Quantum

* Add support for Honeywell and improve exception handling

* Fixes and reformatting

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fix QASM transulation

* Fixes and Improvements

* Documentation related changes

* Fix typos

* Add docstrings to util methods

* Fix typos

* Add Unittests

* Add Unittests

* Add Unittests & rename honeywell to quantinuum

* Fixes for QSAM convector

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Quantinuum Backend for Azure Quantum

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Vdag gate for IonQ backend

* Minor updates

* Update Docs

* Add Azure Quantum example

* Update README.rst

* Update Docs

* Update Docs

* Update Unittests

* Azure Quantum: CI Fixes (#4)

* Azure Quantum: CI Fixes

* Fix optional dependency problem

* Update pre-commit reformatting

* Fix pylint issues

* Fix pylint issues

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Resolve comments (#5)

* Resolve comments

* Remove rearrange_result method from _utils.py

* Update with pytest.approx for assert floating numbers

* Pytest skipif testcases for Azure Quantum (#6)

* Pytest skipif testcases for Azure Quantum

* Fix projectq.backends._azure._exceptions import

* Add common utils module (#7)

* Create common utils module

* Optimize _rearrange_result method

* Make sure pip, setuptools and wheel packages are up to date on CI

* Fix formatting issues from latest changes in develop branch

* Improve coveralls (#8)

* Improve coveralls

* Improve coveralls

* Rename util.py to utils.py

* Minor fixes

* Update testcases

* Update testcases

* Improve coveralls (#9)

* Improve coveralls

* Improve coveralls

* Precommit reformatting

* Improve coveralls (#10)

* Improve coveralls

* Precommit formatting

* Fix CI failures

* Avoid a few more #pragma: no cover

* Fix flake8 warning

* Remove one more # pragma: no cover

* Reformat file

Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Takishima added a commit that referenced this issue Oct 18, 2022
* Merge master into develop branch (#436)

* Preparing release vv0.7.2

* Fix missed bug in optimize.py

* Fix typo in _optimize.py

* Fix linters/formatters warnings

* Update missed hooks

* Hotfix: fix GitHub action workflows

* Release version v0.7.3 (#435)

* Merge master into develop branch (#431)

* Preparing release vv0.7.2

* Fix missed bug in optimize.py

* Fix typo in _optimize.py

* Fix linters/formatters warnings

* Update missed hooks

* Hotfix: fix GitHub action workflows

Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* IonQ API: Move to v0.2, and fixup backends path (#433)

* Move to v0.2, and fixup backends path

The previous path was mistakenly incorrect, could we release this as a patch release of project-Q? Happy to help how I can.

* changelog

* fix

* One more fixup

* remove urljoin

* fmt

* Preparing release v0.7.3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>

Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>

* Bump docker/setup-qemu-action from 1 to 2 (#437)

* Bump docker/setup-qemu-action from 1 to 2

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CHANGELOG

* Fix CentOS 7 build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* Fix setuptools-scm version for Python 3.6 (#440)

* Add `blacken-docs` and `pyupgrade` to pre-commit configuration (#441)

* Add `blacken-docs` and `pyupgrade` to pre-commit configuration

* Apply new pre-commit hooks and fix related issues.

* Update CHANGELOG

* Fix unit tests failures

* Fix pre-commit failure

* Generalise the use of f-strings

* Fix IonQ tests

* Run `pyupgrade` before `isort` and `black`

* Deprecate support for Python 3.6 (#442)

* Azure Quantum backend (#439)

* Add Azure Quantum backend template files

* Add implementation of Azure Quantum

* Add support for Honeywell and improve exception handling

* Fixes and reformatting

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fix QASM transulation

* Fixes and Improvements

* Documentation related changes

* Fix typos

* Add docstrings to util methods

* Fix typos

* Add Unittests

* Add Unittests

* Add Unittests & rename honeywell to quantinuum

* Fixes for QSAM convector

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Quantinuum Backend for Azure Quantum

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Vdag gate for IonQ backend

* Minor updates

* Update Docs

* Add Azure Quantum example

* Update README.rst

* Update Docs

* Update Docs

* Update Unittests

* Azure Quantum: CI Fixes (#4)

* Azure Quantum: CI Fixes

* Fix optional dependency problem

* Update pre-commit reformatting

* Fix pylint issues

* Fix pylint issues

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Resolve comments (#5)

* Resolve comments

* Remove rearrange_result method from _utils.py

* Update with pytest.approx for assert floating numbers

* Pytest skipif testcases for Azure Quantum (#6)

* Pytest skipif testcases for Azure Quantum

* Fix projectq.backends._azure._exceptions import

* Add common utils module (#7)

* Create common utils module

* Optimize _rearrange_result method

* Make sure pip, setuptools and wheel packages are up to date on CI

* Fix formatting issues from latest changes in develop branch

* Improve coveralls (#8)

* Improve coveralls

* Improve coveralls

* Rename util.py to utils.py

* Minor fixes

* Update testcases

* Update testcases

* Improve coveralls (#9)

* Improve coveralls

* Improve coveralls

* Precommit reformatting

* Improve coveralls (#10)

* Improve coveralls

* Precommit formatting

* Fix CI failures

* Avoid a few more #pragma: no cover

* Fix flake8 warning

* Remove one more # pragma: no cover

* Reformat file

Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* Fix installation on Apple Silicon and older Python versions (#444)

* Preparing release v0.8.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sai Seshu Chadaram <ssc1729@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants