GithubHelp home page GithubHelp logo

pasqal-io / qadence-libs Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 931 KB

A collection of libraries to enhance Qadence functionalities.

Home Page: https://pasqal-io.github.io/qadence-libs/latest/

License: Apache License 2.0

Python 100.00%

qadence-libs's People

Contributors

jpmoutinho avatar renovate[bot] avatar roland-djee avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

inafergra

qadence-libs's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/build_docs.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/lint.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/test_fast.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/checkout v4
  • actions/setup-python v5
pep621
pyproject.toml
pip_requirements
docs/requirements.txt

  • Check this box to trigger a request for Renovate to run again on this repository

[Fix] Add the omega term to Rydberg Feature Map Hamiltonian

Currently, the rydberg_feature_map here does not pass any value for omega to AnalogRot which then defaults to 0.

Thus, the Hamiltonian for the Feature map turns out to be something like:

H/h = ∑ᵢ( - δnᵢ) + Hᵢₙₜ.

And with the interaction term being an NN term, this means the Hamiltonian has no driving term at all. Which would mean, if the state that this block gets is the zero state, then nothing drives the state to other states, and we would be left in the zero state.

Considering this is the feature map, we are pretty likely to start with zero state. Thus, it would fail to encode the feature at all.

Need to provide an appropriate driving term to the feature map.

Move openfermion functionalities

In qadence.blocks.manipulate there is some functionality to convert qadence to and from openfermion. This is not widely used but has been used afaik by Igor in the past. I was going to deprecate it for removal, but maybe it can move into qadence_libs.

[ ] Move the relevant files
[ ] Move tests in test_manipulate.py
[ ] Probably remove the ones from test_operators.py
[ ] Move openfermion dependency from qadence to qadence libs

Move qadence.metrics

Currently these metrics are used but copied in protocols tests. It would make sense to have them accessible to all packages that require them to run tests.

[FEATURE] Add helper functions to readily create QNNs

Currently, constructing QNNs requires a bunch of boilerplate code that needs to be repeated, especially when benchmarking different techniques relating to the definition of feature maps, ansatz and the observable used.

Have helper function build_qnn that creates a Qadence QNN and takes the configuration of the feature map (FeatureMapConfig), of the ansatz (AnsatzConfig) and the observable (ObservableConfig).

fm_config = FeatureMapConfig(
    num_features=1,
    basis_set=BasisSet.CHEBYSHEV,
    reupload_scaling=ReuploadScaling.TOWER,
    feature_range=(-1.2, 1.2),
    feature_map_strategy="digital",
    multivariate_strategy="series",
)

ansatz_config = AnsatzConfig(
    num_layers=2,
    ansatz_type="hea",
    ansatz_strategy="rydberg",
)

obs_config = ObservableConfig(detuning_strength="z")

f = build_qnn_model(
    register=3,
    fm_config=fm_config,
    ansatz_config=ansatz_config,
    observable_config=obs_config,
)

Move QNN and TransformedModule

Move to qadence_libs.models.

Maybe also move the current Overlap? It inherits from QuantumModel.

  • In ./module for ml_tools
  • Migrate tests
  • Add libs.py

Move qadence.ml_tools

Fully move to qadence_libs.ml_tools.

But put the TransformedModule in qadence_libs.models

Relates #6

Move qadence.constructors

From qadence.constructors, the following sub-modules can be moved to qadence-libs.constructors:

  • ansatze.py
  • feature_maps.py
  • iia.py
  • qft.py
  • rydberg_feature_maps.py
  • rydberg_hea.py

The following sub-modules remain, which I feel like they belong in qadence. We can discuss about the best place to put them.

  • daqc
  • hamiltonian_factory.py

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.