Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chmwzc committed Feb 5, 2025
1 parent 848b9f7 commit 602250f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/source/api-reference/measurement.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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.
expectation value using sample measurements instead of a state vector simulation.

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

Expand Down
2 changes: 1 addition & 1 deletion src/qibochem/measurement/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def measurement_basis_rotations(hamiltonian, grouping=None):
Args:
hamiltonian (SymbolicHamiltonian): Hamiltonian of interest
grouping: Whether or not to group the X/Y terms together, i.e. use the same set of measurements to get the
grouping: Whether or not to group Hamiltonian terms together, i.e. use the same set of measurements to get the
expectation values of a group of terms simultaneously. Default value of ``None`` will not group any terms
together, while ``"qwc"`` will group qubitwise commuting terms together, and return the measurement gates
associated with each group of X/Y terms
Expand Down
16 changes: 8 additions & 8 deletions src/qibochem/measurement/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def expectation_from_samples(
circuit (qibo.models.Circuit): Quantum circuit ansatz
hamiltonian (qibo.hamiltonians.SymbolicHamiltonian): Molecular Hamiltonian
n_shots (int): Number of times the circuit is run. Default: ``1000``
group_pauli_terms: Whether or not to group Pauli X/Y terms in the Hamiltonian together to reduce the measurement
cost. Available options: ``None``: (Default) Hamiltonian terms containing X/Y are not grouped together, and
group_pauli_terms: Whether or not to group Hamiltonian terms together to reduce the measurement
cost. Available options: ``None``: (Default) No grouping of Hamiltonian terms, and
``"qwc"``: Terms that commute qubitwise are grouped together
n_shots_per_pauli_term (bool): Whether or not ``n_shots`` is used for each Pauli term in the Hamiltonian, or for
*all* the terms in the Hamiltonian. Default: ``True``; ``n_shots`` are used to get the expectation value for each
term in the Hamiltonian.
shot_allocation: Iterable containing the number of shots to be allocated to each term in the Hamiltonian respectively if
n_shots_per_pauli_term is ``False``. Default: ``None``; shots are allocated based on the magnitudes of the coefficients
of the Hamiltonian terms.
n_shots_per_pauli_term (bool): Whether or not ``n_shots`` is used for each Pauli term (or group of terms) in the
Hamiltonian, or for *all* the (group of) terms in the Hamiltonian. Default: ``True``; ``n_shots`` are used
to get the expectation value for each term in the Hamiltonian.
shot_allocation: Iterable containing the number of shots to be allocated to each term (or group of terms) in the
Hamiltonian respectively if n_shots_per_pauli_term is ``False``. Default: ``None``; shots are allocated
based on the magnitudes of the coefficients of the Hamiltonian terms.
Returns:
float: Hamiltonian expectation value
Expand Down

0 comments on commit 602250f

Please sign in to comment.