Skip to main content

Python client library for the OpenAI API

Project description

Fermioniq client for pure state emulation

Installation

Dev

Run locally: pip install -e .[dev]

Setup:

Sending jobs to the emulator requires 'access_token_id' and 'access_token_secret'. Set these as environment variables:

- export FERMIONIQ_ACCESS_TOKEN_ID=""
- export FERMIONIQ_ACCESS_TOKEN_SECRET=""

Or alternatively provide them as input arguments when initializing a ClientConfig.

Relevant Examples

    - step_by_step_example.py         -- general overview
    - run_with_json.py                -- using cirq circuits stored in json format
    - run_with_local_noisemodel.py    -- mixed state emulation with a custom noise model

The emulator can be used as follows:

1: Initialize the Client:

    client = fermioniq.Client()

  Be sure to provide `access_token_id` and `access_token_secret` if they are not set as environment variables.
  Additionally you can set `verbosity` to 0, 1 or 2

2: Initialize a configuration for the emulator, as a python dict or stored as json or yaml. A default configuration with context for each parameter can be found in examples/example_settings/.

    i.e.
    config = {}

    or
    config = {"mode" : "dmrg", "dmrg" : {"D" : 500}}
    Here ``qubits` can be set as a sequence of qubits (qiskit.circuit.Qubit or cirq.Qid), determining the order of output bitstrings.

3. Make a fermioniq.EmulatorJob:

    emulator_job = fermioniq.EmulatorJob(
        circuit = circuit,
        config = config,
    )

    The circuit to emulate should be a qiskit.QuantumCircuit or cirq.Circuit.
    For mixed-state emulation, a `noise_model` must be given as dict or yaml. An example can be found in examples/example_settings/

4. Schedule:

    output = client.schedule_and_wait(emulator_job)

5. Pretty print the output:

    import rich
    rich.print(output)

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

fermioniq-1.0.0-py2.py3-none-any.whl (88.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fermioniq-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: fermioniq-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 88.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for fermioniq-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e8e934024bde48fe8c1a4c64555da37bd9e16c1dcb4ff8c3b10c03bd502a52e1
MD5 2cc9ed6767a1bed480b263fe6541681d
BLAKE2b-256 d5000ba8a9ac0bcd624b5727223ce6433ea87cf071470c3261487027c795b2fb

See more details on using hashes here.

Supported by

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