Skip to content

Commit

Permalink
Merge pull request #154 from Zhaoyilunnn/master
Browse files Browse the repository at this point in the history
fix some bugs
  • Loading branch information
beizhansl committed Apr 1, 2024
2 parents 27b2962 + cd881d2 commit 2f8c0d7
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 74 deletions.
7 changes: 3 additions & 4 deletions quafu/backends/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import re

import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import requests
from quafu.users.userapi import User
from quafu.utils.client_wrapper import ClientWrapper


class Backend(object):
Expand All @@ -38,8 +37,8 @@ def get_chip_info(self, user: User = None):
data = {"system_name": self.name.lower()}
headers = {"api_token": api_token}
url = User.url + User.chip_api
chip_info = requests.post(url=url, data=data, headers=headers)
chip_info = json.loads(chip_info.text)
chip_info = ClientWrapper.post(url=url, data=data, headers=headers)
chip_info = chip_info.json()
json_topo_struct = chip_info["topological_structure"]
qubits_list = []
for gate in json_topo_struct.keys():
Expand Down
Loading

0 comments on commit 2f8c0d7

Please sign in to comment.