Git Product home page Git Product logo

z-quantum-optimizers's Introduction

z-quantum-optimizers

What is it?

z-quantum-optimizers is a module with basic optimizers to be used in workflows with Orquestra โ€“ a platform for performing computations on quantum computers developed by Zapata Computing.

Currently this library includes the following optimizers:

It also supports the optimization of variational circuits.

Usage

Workflow

In order to use z-quantum-optimizers in your workflow, you need to add it as an import in your Orquestra workflow:

imports:
- name: z-quantum-optimizers
  type: git
  parameters:
    repository: "[email protected]:zapatacomputing/z-quantum-optimizers.git"
    branch: "master"

and then add it in the imports argument of your step:

- name: my-step
  config:
    runtime:
      language: python3
      imports: [z-quantum-optimizers]

Once that is done you can:

  • use any z-quantum-optimizers function by specifying its name and path as follows:
- name: optimize-circuit
  config:
    runtime:
      language: python3
      imports: [z-quantum-optimizers]
      parameters:
        file: z-quantum-optimizers/steps/optimizers.py
        function: optimize_variational_circuit
  • use tasks which import zquantum.optimizers in the python code (see below).

Python

Here's an example of how to use methods from z-quantum-optimizers in a python task:

from zquantum.optimizers import ScipyOptimizer
optimizer = ScipyOptimizer(method='L-BFGS-B')

or use optimizer-specs parameter to make our code work with other backends too:

from zquantum.core.utils import create_object
optimizer_specs = {{inputs.parameters.optimizer-specs}}
optimizer = create_object(optimizer_specs)

Even though it's intended to be used with Orquestra, z-quantum-optimizers can be also used as a standalone Python module. This can be done by running pip install . from the src/ directory.

Development and contribution

You can find the development guidelines in the z-quantum-core repository.

Running tests

In order to run tests please run pytest . from the main directory.

In order for the tests related to the daemon optimizer to work you need to first specify FLASK_APP environmental variable: export FLASK_APP=/path/to/z-quantum-optimizer/src/python/orquestra/optimizers/daemon-optimizer/proxy/rest.py.

z-quantum-optimizers's People

Contributors

dexter2206 avatar jama22 avatar martamau avatar max-radin avatar mstechly avatar sabeegrewal avatar simonwa7 avatar zapatabot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.