Skip to content

Commit

Permalink
feat: Use instead of floor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jul 31, 2024
1 parent bcf44a4 commit 9ea76d4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass, field
from math import floor
from typing import Optional

import numpy as np
Expand Down Expand Up @@ -222,7 +221,7 @@ def fit_function(x, w_max, normalization, offset):
# solution to x*popt[1] + popt[2] = k pi
# such that x is close to 0
# to avoid errors due to periodicity
k = floor(popt[2] / np.pi + 0.5)
k = np.round(popt[2] / np.pi)

sweetspot[qubit] = (k * np.pi + popt[2]) / popt[1]
matrix_element[qubit] = popt[1]
Expand Down

0 comments on commit 9ea76d4

Please sign in to comment.