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 hashes)

Uploaded Python 2 Python 3

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