Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Musical Isomorphisms by Default #269

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

lukem12345
Copy link
Member

DiagrammaticEquations PR 67 added support for inferring variables as vector fields and resolving the musical isomorphism functions.

This PR updates our docs pages and internal simulation generation to accommodate this new feature.

A future PR should manage the pre-allocation of vectors of SVectors in an autodiffcache-able way.

@GeorgeR227 assisted in this feature.

@lukem12345 lukem12345 requested a review from GeorgeR227 August 23, 2024 21:56
@@ -5,6 +5,30 @@ using Krylov
using LinearAlgebra
using SparseArrays

# Define mappings for default DEC operations that are not optimizable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by optimizable do you mean able to be represented by a sparse matrix? The function below is called default_dec_matrix_generate, which has matrix in the name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, for example, the sharp operator is a matrix, but we do not allocate memory for their outputs.

If I recall correctly, the generic term "optimizable" as used in this code base just means that the assignment uses either .= syntax or the mul! method when being emitted.

One of the things that I tried to do is amend this state of affairs, by drawing a distinction between operators with special logic that happen to be matrices, operators with special logic that do not happen to be matrices, and operators with no special logic and we do not care if they are matrices or not

end

return (args...) -> op(args...)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the function above is just a move of this + adding the sharp and flat.

src/simulation.jl Outdated Show resolved Hide resolved
src/simulation.jl Outdated Show resolved Hide resolved
src/simulation.jl Outdated Show resolved Hide resolved
@GeorgeR227
Copy link
Collaborator

I'm realizing now that since this PR introduces the non_optimizable class of DEC operators, ones other than sharp/flat, such as dual wedges and such, should also be moved over into the regular default_dec_generate.

This moves operators over from the default matrix generate to the regular default generate to better define the split between operators that have inplace versions and those that don't.
Halmo is still breaking in this PR for some reason
This simulation was using A as a 1-form sized constant, instead of as a regular Float64 constant.
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 78.84%. Comparing base (b030b92) to head (1fed39c).

Files with missing lines Patch % Lines
src/simulation.jl 74.07% 7 Missing ⚠️
src/operators.jl 84.84% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
+ Coverage   78.09%   78.84%   +0.75%     
==========================================
  Files           5        5              
  Lines         630      643      +13     
==========================================
+ Hits          492      507      +15     
+ Misses        138      136       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants