Giter Club home page Giter Club logo

orqviz's Introduction

orqviz

A Python package for easily visualizing the loss landscape of Variational Quantum Algorithms by Zapata Computing Inc.

orqviz provides a collection of tools which quantum researchs and enthusiasts alike can use for their simulations. It works with any framework for running quantum circuits, for example qiskit, cirq, pennylane, and Orquestra. The package contains functions to generate data, as well as a range of flexible plotting and helper functions. orqviz is light-weight and has very few dependencies.

Getting started

In doc/examples/ we provide a range of Jupyter notebook examples for orqviz. We have four Jupyter notebooks with tutorials for how to get started with any quantum circuit simulation framework you might use. You will find examples with qiskit, cirq, pennylane and Zapata's Orquestra library. The tutorials are not exhaustive, but they do provide a full story that you can follow along.

In this notebook we have the Sombrero example that we showcase in our paper. We also have an advanced example notebook which provides a thorough demonstration of the flexibility of the orqviz package.

We have recently published a paper on arXiv where we review the tools available with orqviz. TODO: Link to arXiv.

Installation

You can install our package using the following command:

pip install orqviz

Alternatively you can build the package from source. This is especially helpful if you would like to contribute to orqviz

git clone https://github.com/zapatacomputing/orqviz.git
cd orqviz
pip install -e ./

Examples

import orqviz
import numpy as np

np.random.seed(42)

def loss_function(pars):
    return np.sum(np.cos(pars))**2 + np.sum(np.sin(30*pars))**2

n_params = 42
params = np.random.uniform(-np.pi, np.pi, size=n_params)
dir1 = orqviz.geometric.get_random_normal_vector(n_params)
dir2 = orqviz.geometric.get_random_orthonormal_vector(dir1)

scan2D_result = orqviz.scans.perform_2D_scan(params, loss_function,
                                direction_x=dir1, direction_y=dir2,
                                n_steps_x=100)
orqviz.scans.plot_2D_scan_result(scan2D_result)

This code results in the following plot:

Image

Authors

The leading developer of this package is Manuel Rudolph at Zapata Computing.
For questions related to the visualization techniques, contact Manuel via [email protected] .

The leading software developer of this package is Michał Stęchły at Zapata Computing.
For questions related to technicalities of the package, contact Michał via [email protected] .

You can also contact us or ask general questions using GitHub Discussions.

For more specific code issues, bug fixes, etc. please open a GitHub issue in the orqviz repository.

If you are doing research using orqviz, please cite our paper:

TODO

Thank you to Sukin Sim and Luis Serrano from Zapata Computing for their contributions to the tutorials.

How to contribute

Please see our Contribution Guidelines.

orqviz's People

Contributors

msrudolph avatar mstechly avatar

Watchers

 avatar

Forkers

deyh2020

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.