Skip to content

Commit

Permalink
Merge branch 'master' into stable/0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaoyilunnn committed Jul 28, 2023
2 parents c38d9de + b773a01 commit b7e61df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/quafu/backends/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def __init__(self, backend_info: dict):
# self.task_in_queue = backend_info["task_in_queue"]

def get_chip_info(self, user=User()):
api_token = user.api_token
# update api-token, a patch to be deleted in the future
api_token = user._load_account_token()
data = {"system_name": self.name.lower()}
headers = {"api_token": api_token}
chip_info = requests.post(url=User.chip_api, data=data,
Expand Down
2 changes: 1 addition & 1 deletion src/quafu/elements/quantum_element/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


PosType = Union[int, List[int]]
ParaType = dict[str, Union[float, int]]
ParaType = Union[float, int]


class Instruction(ABC):
Expand Down
5 changes: 4 additions & 1 deletion src/quafu/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class Task(object):
"""

def __init__(self, user=User()):
# update api-token, a patch to be deleted in the future
user._api_token = user._load_account_token()
self.user = user

self.shots = 1000
self.tomo = False
self.compile = True
Expand Down Expand Up @@ -229,7 +232,7 @@ def retrieve(self, taskid: str) -> ExecResult:
data = {"task_id": taskid}
url = User.exec_recall_api

headers = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'api_token': self.token}
headers = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'api_token': self.user.api_token}
res = requests.post(url, headers=headers, data=data)

res_dict = json.loads(res.text)
Expand Down

0 comments on commit b7e61df

Please sign in to comment.