Skip to main content

Internal tools for landscape characterization

Project description

Landscape Tools

Installation

pip install landscape_tools
from landscape_tools import landscape_visualization as lv
from landscape_tools import barren_plateaus as bp

Landscape Characterization

This module provides utilities to analyze and visualize the optimization landscape of variational quantum algorithms (VQAs).

It is designed to work independently of QUICK / HDES internals and can be used with any backend, as long as a suitable cost function is provided.

The main purpose of this module is to:

  • perform 1D and 2D loss landscape scans,
  • analyze loss landscapes in PCA subspaces,
  • study gradient magnitudes and barren plateau effects,
  • visualize trajectories and parameter influence.

Most algorithms implemented here only depend on a generic cost function interface, not on circuits, observables, or backends.

All landscape analysis functions expect a cost function of the form:

f(theta: np.ndarray) -> float

In practice, you must wrap the original cost function so that it only takes the parameter vector as input and returns a scalar value.

def your_cost_function(params, circuit, hamiltonian):
    state = circuit.run(params)
    return expectation_value(state, hamiltonian)

wrapped_loss = lambda p: cost_function(
    p,
    circuit=my_circuit,
    hamiltonian=my_hamiltonian,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

landscape_tools-0.0.4.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

landscape_tools-0.0.4-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file landscape_tools-0.0.4.tar.gz.

File metadata

  • Download URL: landscape_tools-0.0.4.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for landscape_tools-0.0.4.tar.gz
Algorithm Hash digest
SHA256 dbc80a7659e399a0e255cfc6b8db1e62c84d5dafc950db916fad17539d5954c3
MD5 00747011edc1352f205b156dcb4a931c
BLAKE2b-256 6e1022acef8b400f7685151c989a50f827e5db99f8b0913bf75970563c1fd0b4

See more details on using hashes here.

File details

Details for the file landscape_tools-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for landscape_tools-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5cb18243f1afb4e8618685d3dc147f5eb2ee59f804c4c9dd2c83fb6e8c8f5442
MD5 671987a600d83b454e95be48a81befbb
BLAKE2b-256 a768f8912d5689ea7e93348e9feebac84fbb15346e8d8361ef9bb38d208393e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page