https://github.com/toschaefer/lucon.jl

loss optimization under unitary constraint

https://github.com/toschaefer/lucon.jl

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords

loss-functions machine-learning materials-science optimization-algorithms optimization-methods quantum-chemistry wannier-functions
Last synced: 5 months ago · JSON representation

Repository

loss optimization under unitary constraint

Basic Info
  • Host: GitHub
  • Owner: toschaefer
  • License: apache-2.0
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 319 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
loss-functions machine-learning materials-science optimization-algorithms optimization-methods quantum-chemistry wannier-functions
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

Lucon

Build Status

Lucon (Loss optimization under Unitary CONstraint) optimizes loss functions mapping a unitary matrix onto a number. A conjugate-gradient algorithm is used following the work by T. Abrudan et al., Signal Processing 89 (2009) 1704–1714.

The module presents potential applications in various fields. For instance, it can be employed for tasks such as orbital rotations (e.g., orbital localization) in quantum chemistry and materials science, as well as for various tasks in signal processing applications or machine learning algorithms. The main motivation for Lucon.jl is given by orbital localizations for calculations in materials physics and quantum chemistry. These will be referenced here shortly.

The code is designed in a way that users can implement arbitrary loss functionals with little effort for optimization with Lucon.jl. As a template the BrockettLoss.jl functional can be used (see example below).

To provide a very simple and illustrative example of the module's potential use cases, consider the following loss functional that can be used to diagonalize a hermitian matrix. math L(U) = \text{tr}(U^\dagger H U N) Here, $H$ is a hermitian matrix (to be diagonalized) and $N$ is a diagonal matrix with distinct entries in ascending order, $N{nm} = n\delta{nm}$. Lucon finds the optimal $U$ which maximizes the loss functional. For this particular choice of $L(U)$ (also known as Brockett criterion), the optimal unitary matrix is the one that diagonalizes $H$.

Install

In the Julia REPL, simply run the following commands: julia using Pkg Pkg.add("Lucon")

Usage

In order to use Lucon to optimize a loss functional $L(U)$ one has provide a Julia function that calculates the Eucledean derivative $\Gamma{ij} = \partial L / \partial u^*{ij}$. For the above example (Brockett criterion) the Eucledean derivative simply reads $\Gamma = \partial L /\partial U^\dagger = H U N$.

To this end a sub-type of the abstract type Lucon.LossFunctional has to be defined which can hold all quantities necessary for the loss functional (for the example, it is only the hermitian matrix $H$). The Eucledean derivative has to be provided by overloading the function Lucon.EuclideanDerivative.

```julia import Lucon

struct LossFunctional <: Lucon.LossFunctional H::Hermitian{<:Number} end

function Lucon.EuclideanDerivative( L::LossFunctional, U::Matrix{T}, CalcLoss::Bool )::Tuple{Matrix{T},Float64} where T<:Number Γ = zero(similar(U)) # Euclidean derivative has same type and dimension as U Loss = 0.0 # the value of the Loss functional dim = size(L.H,1) N = Diagonal([1.0n for n=1:dim]) # the N matrix is a diagonal matrix with entries N_nn = n Γ = L.HUN (CalcLoss == true) && (Loss = real(tr(U'Γ))) return (Γ, Loss) end The optimization can then be performed via julia

set up your hermitian matrix H and initial unitary U

L = LossFunctional(H) (U, Loss) = optimize(L,U) ``` The full example and its usage can be found in the source file BrockettLoss.jl and in the test file runtests.jl.
Both can be used as a template to implement arbitrary loss functionals.

How to cite?

Benjamin Wöckinger, Alexander Rumpf, Tobias Schäfer. Exploring Intrinsic Bond Orbitals in Solids, arXiv:2409.18212

Owner

  • Login: toschaefer
  • Kind: user

GitHub Events

Total
  • Create event: 1
  • Commit comment event: 1
  • Release event: 1
  • Issue comment event: 1
  • Push event: 1
Last Year
  • Create event: 1
  • Commit comment event: 1
  • Release event: 1
  • Issue comment event: 1
  • Push event: 1

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
juliahub.com: Lucon

loss optimization under unitary constraint

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 9.8%
Dependent packages count: 38.0%
Average: 42.1%
Forks count: 54.4%
Stargazers count: 66.3%
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v3 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite