Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
Signed-off-by: Alex McCaskey <[email protected]>
  • Loading branch information
amccaskey authored and Pooja Rao committed Nov 29, 2023
1 parent 2b200e9 commit 10b6aaf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qswift/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def __init__(self, operator_pool: OperatorPool, obs_map, initializer: CircuitIni
self._tool = tool

def compute(self, code, **kwargs):
# qpu_id = kwargs['qpu_id'] if 'qpu_id' in kwargs else 0

ancilla_index = self._nqubit - 1
qc = self._initializer.init_circuit(self._nqubit, {ancilla_index}, self._tool)
operators = []
Expand All @@ -149,10 +151,10 @@ def compute(self, code, **kwargs):
if isinstance(operator, MeasurementOperator):
tmp = self._observables[operator.j].get_value(qc, self._nshot, **kwargs)
if isinstance(tmp, float):
value = coeff * tmp
else:
value = (coeff, tmp)
return value
return coeff * tmp

return (coeff, tmp)

raise AttributeError("measurement is not set")

def add_gate(self, qc: QWrapper, operator: Operator, tau, ancilla_index, targets):
Expand Down

0 comments on commit 10b6aaf

Please sign in to comment.