Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Oct 28, 2024
2 parents a8f8681 + c771c29 commit 871e997
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
9 changes: 4 additions & 5 deletions qiskit_addon_sqd/counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ def counts_to_arrays(counts: dict[str, float | int]) -> tuple[np.ndarray, np.nda
counts: The counts dictionary to convert
Returns:
A tuple containing:
- A 2D array representing the sampled bitstrings. Each row represents a
bitstring, and each element is a ``bool`` representation of the
bit's value
- A 1D array containing the probability with which each bitstring was sampled
- A 2D array representing the sampled bitstrings. Each row represents a
bitstring, and each element is a ``bool`` representation of the
bit's value
- A 1D array containing the probability with which each bitstring was sampled
"""
if not counts:
Expand Down
16 changes: 7 additions & 9 deletions qiskit_addon_sqd/fermion.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ def solve_fermion(
verbose: A verbosity level between 0 and 10
Returns:
A tuple containing:
- Minimum energy from SCI calculation
- The SCI ground state
- Average occupancy of the alpha and beta orbitals, respectively
- Expectation value of spin-squared
- Minimum energy from SCI calculation
- The SCI ground state
- Average occupancy of the alpha and beta orbitals, respectively
- Expectation value of spin-squared
"""
if isinstance(bitstring_matrix, tuple):
Expand Down Expand Up @@ -212,10 +211,9 @@ def optimize_orbitals(
learning_rate: The learning rate to use during gradient descent
Returns:
A tuple containing:
- The groundstate energy found during the last optimization iteration
- An optimized 1D array defining the orbital transform
- Average orbital occupancy
- The groundstate energy found during the last optimization iteration
- An optimized 1D array defining the orbital transform
- Average orbital occupancy
"""
if isinstance(bitstring_matrix, tuple):
Expand Down

0 comments on commit 871e997

Please sign in to comment.