Giter VIP home page Giter VIP logo

quantumsymbolics.jl's Introduction

QuantumSymbolics

Computer algebra tools for symbolic manipulations in quantum mechanics and quantum information.

Documentation Documentation of latest stable version Documentation of dev version
Continuous integration GitHub Workflow Status Buildkite Workflow Status
Code coverage Test coverage from codecov
Static analysis with JET static analysis Aqua QA

quantumsymbolics.jl's People

Contributors

apkille avatar ba2tro avatar dependabot[bot] avatar github-actions[bot] avatar krastanov avatar thofma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quantumsymbolics.jl's Issues

All struct fields should be (concretely) typed (potentially with a type parameter) [$200]

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Project: All struct fields should be (concretely) typed (potentially with a type parameter) [$200]

Many of the symbolic types in this library are rather clumsily defined, without much attention being paid to the types of their fields. The goal of this bounty is to specify them and parameterize them as much as possible and reasonable, in preparation for next steps like the use of sum types and Unityper.jl. This forum discussion might provide useful background.

Required skills: Understanding of Symbolics.jl and Julia's type system

Reviewer: Stefan Krastanov

Duration: 1 month

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

use set equality when checking for expression equality of commutative terms (and potentially generally use sets for commutative terms)

we already have

julia> Set([X1, X2]) == Set([X1, X2])
true

julia> Set([X1, X2]) == Set([X1, Z1])
false

Set uses hashing for quick (potentially false positive) equality check in inclusion (log(n)), followed by isequal check to avoid false positive. Thus set equalities have cost of n log(n) instead of n^2 without the use of a smart datastructure.

Initially there was a worry that Set uses ==, which would have broken its use with Symbolics (where == is used to create a symbolic equation), but that does not seem to be the case.

To avoid creating a new Set at every equality check, we should probably have it as part of the structure. E.g.

@withmetadata struct SAdd{T<:QObj} <: Symbolic{T}
    dict
    _set_precomputed
    _arguments_precomputed
end

It will take a bit more memory (not much given that the objects are not copied, only referenced), but it should speed up a lot of other code.

pinging @apkille as we had been discussing this in #40

Unable to take tensor product of outer products

julia> @ket k; @bra b;

julia> (k*b) ⊗ (k*b)
ERROR: MethodError: *(::SKet, ::SKet) is ambiguous.

Candidates:
  *(x::SymbolicUtils.Symbolic{T}, c) where T<:Union{QuantumInterface.AbstractBra, QuantumInterface.AbstractKet, QuantumInterface.AbstractOperator, QuantumInterface.AbstractSuperOperator}
    @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:34
  *(c, x::SymbolicUtils.Symbolic{T}) where T<:Union{QuantumInterface.AbstractBra, QuantumInterface.AbstractKet, QuantumInterface.AbstractOperator, QuantumInterface.AbstractSuperOperator}
    @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:33

Possible fix, define
  *(::SymbolicUtils.Symbolic{T}, ::SymbolicUtils.Symbolic{T}) where {T<:Union{…}, T<:Union{…}}

Stacktrace:
 [1] prefactorscalings(xs::Vector{SOuterKetBra}; scalar::Bool)
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/rules.jl:26
 [2] prefactorscalings
   @ ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/rules.jl:19 [inlined]
 [3] STensorOperator(terms::Vector{SOuterKetBra})
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:158
 [4] tensor(::SOuterKetBra, ::SOuterKetBra)
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:170
 [5] top-level scope
   @ REPL[4]:1
Some type information was truncated. Use `show(err)` to see complete types.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Thorough benchmarks [$200]

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Project: "Thorough benchmarks" [$200]

We have a small benchmark suite already implemented for our other repositories, which is executed as part of our CI runs. It is defined in the benchmark folder and reported for each pull request. We would like to implement a similar benchmark suite here to include many facets of this library. E.g. basic symbolic operations, simplifications, rule application, flattening and expanding, expressing into numerical backends, time to import, etc. The new benchmarks should be legible, easy to follow, and organized by topic. Most of them should be microbenchmarks testing only one concept, but a few holistic benchmarks would make sense as well.

Required skills: Generic Julia skills.

Reviewer: Stefan Krastanov

Duration: 1 month

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

# Move the test runner to use TestItems.jl [$200]

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Move the test runner to use TestItems.jl [$200]

[TestItems.jl](Move the test runner to use TestItems.jl [$200]) permits more convenient execution of tests from withing an IDE like VSCode. Without significantly rewriting tests and while preserving the use of SafeTestsets, move our test suite to be based around TestItems.jl.

Required skills: Understanding of the julia test runner infrastructure.

Reviewer: Stefan Krastanov

Duration: Expected duration of the project (except potential review overhead)

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

Tensor Networks Backend [$400]

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Project: "Tensor Networks Backend" [$400]

One of the main design goals of this library is to provide a symbolic front end for many different numerical representations of quantum states and operations. This is done chiefly through the express API. Currently, we have baseline support for state vectors (an interface to QuantumOptics.jl) and for stabilizer tableaux (an interface to QuantumClifford.jl).

In this project we are pursuing an implementation of a similar symbolic-to-numeric interface for a numerical tensor network representation for many of these states and operators. The majority of the already available symbolic operations and pre-defined objects from this symbolic library should be supported. New "predefined" symbolic objects that are common for tensor network problems should be defined as necessary. The contributor should investigate and defend what would be the best tensor network backend -- ITensor.jl seems like a plausible choice.

Required skills: Familiarity with tensor networks

Reviewer: Stefan Krastanov

Duration: Can be reserved for 2 months and potentially extended

Publication: In the next 2 years we plan to release a paper in a selective journal about this software. Contributing to this issue would deserve a co-authorship status on such a paper (if the contributor so desires)

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

`IndentityOp` seems to be destroying some basis information

julia> express(IdentityOp(X1))
Operator(dim=3x3)
  basis: Fock(cutoff=2)
Eye(3)

julia> express(X1)
Ket(dim=2)
  basis: Spin(1/2)
 0.7071067811865475 + 0.0im
 0.7071067811865475 + 0.0im

I would have expected the basis to be the same in both cases, but it seems IndentityOp is losing some information and defaulting to a Fock basis even when it should not be a Fock basis.

@apkille , any idea what introduced this? It was detected by the QuantumSavory tests, which regrettably we did not run because we were having a breaking release

A backend for QuantumCumulants.jl [$200]

A backend for QuantumCumulants.jl [$200]

The QuantumCumulants library (part of the QuantumOptics organization) provides for an elegant way to solve truncated differential equations for expectation values of quantum observables. To claim this bounty you need to create an express interface for converting symbolic objects from QuantumSymbolics into objects QuantumCumulants can work with.

Required skills: Knowledge of the QuantumCumulants library

Reviewer: Stefan Krastanov and/or @david-pl

Duration: 2 months

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Aqua static analysis [$200]

Bug bounty logistic details (click to expand)

To claim exclusive time to work on this bounty either post a comment here or message [email protected] with:

  • your name
  • github username
  • (optional) a brief list of previous pertinent projects you have engaged in

Currently the project is claimed by no one until ....

If you want to, you can work on this project without making a claim, however claims are encouraged to give you and other contributors peace of mind. Whoever has made a claim takes precedence when solutions are considered.

You can always propose your own funded project, if you would like to contribute something of value that is not yet covered by an official bounty.

Project: Aqua static analysis [$200]

We run Aqua.jl static analysis during CI for this library, but currently, we have disabled the piracy and ambiguity checks, as they raise too many errors. This bounty is awarded for fixing these issues and enabling these checks. The bounty might require upstreaming some work from here into QuantumInterface.jl or other packages.

Required skills: Generic Julia skills.

Reviewer: Stefan Krastanov

Duration: 1 month

Payout procedure:

The Funding for these bounties comes from the National Science Foundation and from the NSF Center for Quantum Networks. The payouts are managed by the NumFOCUS foundation and processed in bulk once every two months. If you live in a country in which NumFOCUS can make payments, you can participate in this bounty program.

Click here for more details about the bug bounty program.

Fixing equality for metadata-decorated composite types

Describe the bug 🐞

The macro @withmetadata adds a metadata property to a defined struct. This becomes an issue when propsequal is called because this function evaluates equality of two symbolic objects by evaluating the equality of their properties. But we shouldn't care about metadata when evaluating equality, as that only contains information about the cached results from express.

Minimal Reproducible Example 👇

julia> state1 = XBasisState(1, SpinBasis(1//2))
|X₁⟩

julia> state2 = XBasisState(1, SpinBasis(1//2))
|X₁⟩

julia> isequal(state1, state2)
false

julia> QuantumSymbolics.propsequal(state1, state2)
false

julia> i1, b1, m1 = propertynames(state1)
(:idx, :basis, :metadata)

julia> i2, b2, m2 = propertynames(state2)
(:idx, :basis, :metadata)

julia> isequal(getproperty(state1, m1), getproperty(state2, m2))
false

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.