Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some bugs #154

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading