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

Reduce measurement cost using qubit-wise commutativity #95

Merged
merged 35 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bdbe5cb
Add function to check if two Pauli strings commute
chmwzc Mar 7, 2024
d8a3fae
Merge branch 'main' into qwc
chmwzc Apr 3, 2024
814a4cc
Merge branch 'main' into qwc
chmwzc Apr 4, 2024
78435b7
Rename expectation.py to result.py
chmwzc Apr 9, 2024
a222394
Add test coverage
chmwzc Apr 9, 2024
08686f2
Change input of commutativity test function
chmwzc Apr 11, 2024
1b9f05a
De-bug function and tests for grouping H terms
chmwzc Apr 11, 2024
b8fd8c3
Add function to add M gates for a group of H terms
chmwzc Apr 11, 2024
e616db4
Finish drafting QWC code. To add tests next
chmwzc Apr 11, 2024
5a21b77
Update H2 sample expectation test to use QWC
chmwzc Apr 11, 2024
cb69ed1
Bug fix and add more tests
chmwzc Apr 11, 2024
5be727d
Split up samples part of expectation function
chmwzc Apr 17, 2024
423bb35
Update tests and fix __init__.py
chmwzc Apr 17, 2024
4359811
Refactor old code to use new QWC-related functions
chmwzc Apr 17, 2024
f22587e
Backup small fixes before starting on major edits
chmwzc Apr 18, 2024
b710b5b
Bugfix: Add qubit_map from M gates.target_qubits
chmwzc Apr 18, 2024
9fff2be
Merge branch 'main' into qwc
chmwzc Apr 18, 2024
50de0d9
Update docstrings
chmwzc Apr 19, 2024
7be0bd3
Add module docstring
chmwzc Apr 22, 2024
331058e
Merge branch 'main' into qwc
chmwzc Apr 22, 2024
9d0887d
Draft expectation_from_samples API documentation
chmwzc Apr 23, 2024
f129a18
QWC tutorial, first draft
chmwzc Apr 23, 2024
069b96a
Finish outlining draft of QWC tutorial
chmwzc Apr 23, 2024
75c7863
Continue drafting QWC tutorial
chmwzc Apr 24, 2024
70c473b
More stuff added to QWC tutorial
chmwzc Apr 24, 2024
3cd18b2
Finish explaining QWC and an example
chmwzc Apr 24, 2024
d4c6448
Finish first draft of QWC tutorial
chmwzc Apr 25, 2024
71d4bf7
Cleanup old text
chmwzc Apr 25, 2024
99278a3
Minor edits before starting on grouping section
chmwzc Apr 25, 2024
8bec1e5
Finalise draft QWC tutorial (almost)
chmwzc Apr 25, 2024
10170fc
Add Figures and reference paper
chmwzc Apr 26, 2024
d08fb1d
Update Figures; Minor text changes
chmwzc Apr 29, 2024
f8b0b6b
Minor updates
chmwzc Apr 29, 2024
57dd305
doc: minor changes to tutorials
damarkian Apr 29, 2024
4693517
doc: fix typo
damarkian Apr 29, 2024
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
20 changes: 17 additions & 3 deletions doc/source/api-reference/measurement.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@
Measurement
===========

This section covers the API reference for obtaining the expectation value of a (molecular) Hamiltonian
This section covers the API reference for obtaining the expectation value of a (molecular) Hamiltonian, either from a
state vector simulation, or from sample measurements.

Expectation value of Hamiltonian
--------------------------------

.. autofunction:: qibochem.measurement.result.expectation

.. _expectation-samples:

.. autofunction:: qibochem.measurement.result.expectation_from_samples

Measurement cost reduction
--------------------------

The following functions are used for reducing and optimising the measurement cost of obtaining the Hamiltonian
expectation value when sample measurements are used.

.. autofunction:: qibochem.measurement.optimization.measurement_basis_rotations

.. autofunction:: qibochem.measurement.optimization.allocate_shots

.. autofunction:: qibochem.measurement.expectation
2 changes: 1 addition & 1 deletion doc/source/tutorials/ansatz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ The orthonormal molecular orbitals :math:`\phi` are optimized by a direct minimi

.. [#f6] Piela, L. (2007). 'Ideas of Quantum Chemistry'. Elsevier B. V., the Netherlands.

.. [#f7] Clements W. R. et al., 'Optimal Design for Universal Multiport Interferometers', Optica 3 (2016) 1460.
.. [#f7] Clements, W. R. et al., 'Optimal Design for Universal Multiport Interferometers', Optica 3 (2016) 1460.
4 changes: 4 additions & 0 deletions doc/source/tutorials/bk_ham_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions doc/source/tutorials/h2_terms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading