Skip to main content

Simulate Qiskit circuits using quimb

Project description

qiskit-quimb

Simulate Qiskit circuits using quimb.

Documentation

Documentation is located at the project website.

Installation

pip install qiskit-quimb

Usage

The qiskit_quimb module exposes three functions:

  • quimb_circuit: Converts a Qiskit circuit to a quimb circuit.
  • quimb_gates: Converts a Qiskit circuit to a list of quimb gates, which is a bit more flexible.
  • quimb_gate: Converts a Qiskit gate to a quimb gate.

For details, refer to the API documentation.

Code example

import quimb.tensor
from qiskit.circuit import QuantumCircuit, QuantumRegister
from qiskit_quimb import quimb_circuit

# Build a Qiskit circuit
qubits = QuantumRegister(2)
circuit = QuantumCircuit(qubits)
a, b = qubits
circuit.h(a)
circuit.cx(a, b)

# Convert it to a quimb circuit
quimb_circ = quimb_circuit(circuit)

# Sample 10 bitstrings
samples = list(quimb_circ.sample(10, seed=1234))
print(samples)

# You can specify the quimb Circuit subclass and keyword arguments for the constructor
quimb_circ = quimb_circuit(
    circuit, quimb_circuit_class=quimb.tensor.CircuitMPS, max_bond=20
)
samples = list(quimb_circ.sample(10, seed=1234))
print(samples)
['00', '00', '11', '00', '11', '00', '11', '00', '11', '11']
['11', '11', '00', '00', '11', '00', '11', '11', '11', '00']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qiskit_quimb-0.0.10.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qiskit_quimb-0.0.10-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_quimb-0.0.10.tar.gz.

File metadata

  • Download URL: qiskit_quimb-0.0.10.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qiskit_quimb-0.0.10.tar.gz
Algorithm Hash digest
SHA256 ef28a0f85ddf8ebde395c2605c51aa980ba5cbf9a2eae931f898317dbe112f44
MD5 3695fc8fe582b6ceaca4eb45a4abd09a
BLAKE2b-256 6a7f84154bcccc577f38422c09505c48d18177e37e262f5f62d7d536cf201ddf

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_quimb-0.0.10.tar.gz:

Publisher: publish-to-pypi.yml on qiskit-community/qiskit-quimb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qiskit_quimb-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: qiskit_quimb-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qiskit_quimb-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a185d1426aac2e2cb07cc40e1ac3011531b56cdb4d67893244406ee681ce497a
MD5 4fdad215426ef8fbaefc0ebbf0b95af1
BLAKE2b-256 a5180d7644815605427689bfc0ee21e0bb4ce483f7b146dfca8bd4147f7b5a40

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_quimb-0.0.10-py3-none-any.whl:

Publisher: publish-to-pypi.yml on qiskit-community/qiskit-quimb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page