Qiskit..qiskit里找不到Aer这个库,运行不了, 报错信息:from qiskit import QuantumCircuit, Aer, executeImportError: cannot import name 'Aer' from 'qiskit'求解答。
您好,我按照您说的步骤,安好了qiskit,在编写代码时Aer, execute这两个模块导入不进来,一直报错,不知该怎么办 2024-06-04 回复喜欢 Joshua Ni 可以直接安装 qiskit >= 1.0,qiskit 官网有介绍的,Aer 已经变成 qiskit_aer 里的 AerSimulator 了 2024-11-13 回复喜欢 知乎用户 请问你解决了吗 ...
然后就是用书里创建5个“0”qubits的code来测试qiskit和IBMQ backend 之间的连接: import time q = qiskit.QuantumRegister(5) c = qiskit.ClassicalRegister(5) qc = qiskit.QuantumCircuit(q, c) qc.measure(q, c) job_exp = qiskit.execute(qc, backend=backend) 我们可以visualize这个结果 from qiskit.t...
qc.initialize(initial_state,0)# Initialize the0th qubitinthe state`initial_state`qc.save_statevector()# Save statevector qobj=assemble(qc)state=sim.run(qobj).result().get_statevector()# Execute the circuitprint(state)# Print the result Statevector([0.70710678+0.j, 0.+0.70710678j],dims=...
from qiskit import QuantumCircuit, Aer, execute # 创建一个量子电路 circuit = QuantumCircuit(2) circuit.h(0) #在q0上应用H门 circuit.cx(0, 1) #在q0和q1上应用CNOT门 # 执行量子电路 backend = Aer.get_backend('qasm_simulator') job = execute(circuit, backend, shots=1024) result = job....
The quantum circuit model is anion that hides the underlying physical implementation of gates and measurements on a quantum computer. For precise control of real quantum hardware, the ability to execute pulse and readout-level instructions is required. To that end, we introduce Qiskit Pulse, a pu...
In[4]:# Use Aer's qasm_simulatorbackend_sim=Aer.get_backend('qasm_simulator')# Execute the circuit on the qasm simulator.# We've set the number of repeats of the circuit# to be 1024, which is the default.job_sim=execute(mul.qc,backend_sim,shots=1)# Grab the results from the job...