Skip to content

Commit

Permalink
fix: minor fixes to docstring and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Oct 18, 2024
1 parent 68d4e55 commit 63fba04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qibo/hamiltonians/hamiltonians.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,23 +556,23 @@ def calculate_dense(self):
def expectation(self, state, normalize=False):
return Hamiltonian.expectation(self, state, normalize)

def _exp_from_circuit(self, circuit: dict, qubit_map: dict, nshots: int = None):
def _exp_from_circuit(self, circuit: Circuit, qubit_map: dict, nshots: int = None):
"""
Calculate the expectation value from a circuit.
This allows for non diagonal observables. Each term of the observable is
treated separately, by measuring in the correct basis and re-executing the
circuit.
Args:
circuit (dict): input frequencies.
circuit (Circuit): input frequencies.
qubit_map (dict): qubit map.
Returns:
(float): the calculated expectation value.
"""
from qibo import Circuit, gates

if nshots is None:
if nshots is None: # pragma: no cover
nshots = 1000
rotated_circuits = []
coefficients = []
Expand Down

0 comments on commit 63fba04

Please sign in to comment.