
Я что-то упустил? Неужели вы сейчас не можете спланировать эти вещи для их машин? Я вижу в Интернете несколько ссылок, которые, кажется, указывают на то, что вы можете каким-то образом это сделать. Есть ли у кого-нибудь какие-нибудь советы, как я могу заставить этот график работать? Мой код ниже. Заранее спасибо за помощь!
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit.visualization import plot_gate_map, plot_error_map
import matplotlib.pyplot as plt
# Read the API token from the file.
with open('ibm_quantum_token.txt', 'r') as token_file:
api_token = token_file.read().strip()
# Save the token to your Qiskit account configuration.
QiskitRuntimeService.save_account(channel="ibm_quantum", token=api_token, set_as_default=True, overwrite=True)
# Load saved credentials
service = QiskitRuntimeService()
print("Account loaded successfully!")
from qiskit.visualization import plot_gate_map, plot_error_map
import matplotlib.pyplot as plt
backends = service.backends()
print("Available backends:")
for backend in backends:
# Print the name of each backend.
print(backend)
fig_gate_map = plt.figure(figsize=(8, 6))
plot_gate_map(backend)
plt.title(f"Gate Map of {backend.name}", fontsize=16)
plt.show()
fig_error_map = plt.figure(figsize=(8, 6))
plot_error_map(backend)
plt.title(f"Gate Error of {backend.name}", fontsize=16)
plt.savefig("gate_error:"+ str(backend.name) + str(".pdf"))
plt.show()
Подробнее здесь: https://stackoverflow.com/questions/793 ... r-notebook
Мобильная версия