QuantumRings toolkit for Qiskit 1.x
Project description
Step 1. Import the required libraries
from qiskit.circuit import QuantumCircuit
from qiskit import QuantumCircuit, transpile, QuantumRegister, ClassicalRegister, AncillaRegister
from qiskit.visualization import plot_histogram
from matplotlib import pyplot as plt
import QuantumRingsLib
from QuantumRingsLib import QuantumRingsProvider
from quantumrings.toolkit.qiskit import QrBackendV2
from quantumrings.toolkit.qiskit import QrJobV1
from matplotlib import pyplot as plt
Step 2. Obtain the Quantum Rings Provider
Do not forget to replace your account key and account name.
qr_provider = QuantumRingsProvider(token = <ACCOUNT_KEY>, name=<ACCOUNT_NAME>)
Step 3. Build the Quantum Circuit using Qiskit provided functions
shots = 1000
numberofqubits = int(qr_provider.active_account()["max_qubits"])
q = QuantumRegister(numberofqubits , 'q')
c = ClassicalRegister(numberofqubits , 'c')
qc = QuantumCircuit(q, c)
# Create the GHZ state (Greenberger–Horne–Zeilinger)
qc.h(0);
for i in range (qc.num_qubits - 1):
qc.cx(i, i + 1);
# Measure all qubits
qc.measure_all();
Step 4. Transpile the code for Quantum Rings SDK
mybackend = QrBackendV2(qr_provider)
qc_transpiled = transpile(qc, mybackend)
Step 5. Execute the code and plot the histogram
job = mybackend.run(qc_transpiled, shots = shots)
result = job.result()
counts = result.get_counts()
plot_histogram(counts)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantumrings_toolkit_qiskit-0.1.20-py3-none-any.whl.
File metadata
- Download URL: quantumrings_toolkit_qiskit-0.1.20-py3-none-any.whl
- Upload date:
- Size: 66.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3b54bb0f880a04260eac0f742b3f710208101d0c3c6ec32b51125457945f1fd
|
|
| MD5 |
45598dbbace4c5776e1b92a422a6c49c
|
|
| BLAKE2b-256 |
e539f76701caf268e70c834320897e4161aeeffafb48138892f5e217d66367e0
|