Skip to main content

Implements Double-Bracket Quantum Imaginary Time Evolution (DB-QITE) in Qiskit

Project description

Double-Bracket Quantum Imaginary Time Evolution (DB-QITE)

Implementation of DB-QITE (by Gluza et al) and Ground state by DBI (by Gluza)

This repository implements two recently emerged algorithms for Hamiltonian ground state preparation:

  • DB-sorter: Based on DBI algorithm sorts the eigenvalues and eigenvectors and chooses the smallest one
  • DB-QITE: Mimics imaginary time evolution by approximating Hamiltonian commutation with |0><0|

Brockett Flow DBI Flow

Installation

pip install db-qite

Usage

To create a QuantumCircuit

DB-sorter

from db_qite import DB_Sorter

dbq = DB_Sorter(
    hamiltonian = H,         # hamiltonian: `SparsePauliOp`
    time_step = s,           # time step. list or a single value
    trotterization = True,   # whether to approx H, default True
)

circuit = dbq.create_circuit(
    num_steps,               # #iterations
)

DB-QITE

from db_qite import DB_QITE

dbq = DB_QITE(
    hamiltonian = H,         # hamiltonian: `SparsePauliOp`
    initial_state = None,    # initial_state array-like, default None
    time_step = s,           # time step. list or a single value
    trotterization = True,   # whether to approx H, default True
)

circuit = dbq.create_circuit(
    num_steps,               # #iterations
    random_u0,               # boolean. U0 is random or not
)

Run for a range of iterations with plots

DB-sorter

from db_qite import db_sorter_range

runner, results = db_sorter_range(
    hamiltonian=H,
    time_step=.5,       # or a list
    num_steps_range=range(1, 3),
    backend=None, #  or "simulator" or a Qiskit Backend
    estimate_energy=True, # wether to estimate energy or just prepare the state
    shots=1024
)

DB-QITE

from db_qite import db_qite_range

runner, results = db_qite_range(
    hamiltonian=H,
    initial_state=None, # or initial state
    time_step=.5,       # or a list
    random_u0=True,     # or False
    num_steps_range=range(1, 6),
    backend="simulator", #  or None to detect a qiskit backend
    estimate_energy=True, # wether to estimate energy or just prepare the state
    shots=1024
)

Note: if you provide None, or a qiskit backend name or object, it will run on IBM quantum machines. You have to set IBM_QUANTUM_TOKEN environment variable for it

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

db_qite-0.0.8.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

db_qite-0.0.8-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file db_qite-0.0.8.tar.gz.

File metadata

  • Download URL: db_qite-0.0.8.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for db_qite-0.0.8.tar.gz
Algorithm Hash digest
SHA256 9ede847cca998b25ee5eff284b0ba6fbc513a75f3dad24ea0e3062dc872428fe
MD5 6a1f8ba5a7d4e209fbdc733749a2f7b8
BLAKE2b-256 6d67f2c4ade18113af9f63e1a889c553a0e748079176650f9e45048f6a5fd758

See more details on using hashes here.

File details

Details for the file db_qite-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: db_qite-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for db_qite-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c8c8ea4f6f92fd4ac16337a5212c8011bfa6ee592711419e94d826f6201e0c07
MD5 becb70947d5eda728255ada0f05cf2eb
BLAKE2b-256 cb35abd978f24831ed1dce3a2b9628e0d2f1c389eee5bf8bf8e70648461c39c3

See more details on using hashes here.

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