New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ga-vqc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ga-vqc

Genetic Algorithm for VQC ansatz search.

  • 1.0.14
  • PyPI
  • Socket score

Maintainers
1

This is a module to support Variational Quantum Circuits by optimizing the ansatz. The ansatz optimization is performed using a Genetic Algorithm, which can be parallelized with GPUs.

For a detailed example of using this package see the https://github.com/tcoulvert/QAE_4_HEP repository.

Installation

Run the following to install:

$ pip install ga-vqc

Contributors

This module was developed through the Caltech SURF program. Special thanks to my mentor at Caltech.

  • Jean-Roch (California Institute of Technology, Pasadena, CA 91125, USA)

Usage

import ga_vqc as gav

## Config (hyperparameters) for GA, see full list in example ##

vqc_main = <'Function that handles running your VQC optimization'>

# Example of allowed optimization gates, see Genepool.py for documentation
gates_dict = {"I": (1, 0), "RX": (1, 1), "CNOT": (2, 0)}
gates_probs = [0.35, 0.35, 0.3]
genepool = gav.Genepool(gates_dict, gates_probs)

vqc_config = {
    'num_qubits': 3,
    'etc': <'whatever config params your VQC model requires'>
}

ga_output_path = FILEPATH_FOR_GA_OUTPUT

config = gav.Config(vqc_main, vqc_config, genepool, ga_output_path)

# Create the GA with the given hyperparameters
ga = gav.setup(config)

# Evolve the GA and search for the best ansatz
ga.evolve()

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc