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

fixes after the rewrite of symmetry.jl #33

Merged
merged 3 commits into from
Sep 15, 2023
Merged

Conversation

kalmarek
Copy link
Contributor

;)

at least this time I get

ERROR: LoadError: MethodError: no method matching isless(::ComplexF64, ::ComplexF64)

Closest candidates are:
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  isless(::Missing, ::Any)
   @ Base missing.jl:87

Stacktrace:
  [1] <(x::ComplexF64, y::ComplexF64)
    @ Base ./operators.jl:343
  [2] _permutation_quasi_upper_triangular(S::Matrix{ComplexF64})
    @ SumOfSquares.Certificate.Symmetry ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/block_diag.jl:43
  [3] orthogonal_transformation_to(A::Matrix{ComplexF64}, B::Matrix{ComplexF64})
    @ SumOfSquares.Certificate.Symmetry ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/block_diag.jl:110
  [4] ordered_block_diag(As::Vector{Matrix{ComplexF64}}, d::Int64)
    @ SumOfSquares.Certificate.Symmetry ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/block_diag.jl:144
  [5] (::SumOfSquares.Certificate.Symmetry.var"#15#17"{ComplexF64, SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, SumOfSquares.Certificate.Symmetry._OrthogonalMatrix})(summand::SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}})
    @ SumOfSquares.Certificate.Symmetry ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/wedderburn.jl:187
  [6] iterate
    @ ./generator.jl:47 [inlined]
  [7] collect_to!(dest::Vector{Vector{FixedPolynomialBasis{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}, Vector{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}}}}}, itr::Base.Generator{Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, SumOfSquares.Certificate.Symmetry.var"#15#17"{ComplexF64, SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, SumOfSquares.Certificate.Symmetry._OrthogonalMatrix}}, offs::Int64, st::Int64)
    @ Base ./array.jl:840
  [8] collect_to_with_first!(dest::Vector{Vector{FixedPolynomialBasis{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}, Vector{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}}}}}, v1::Vector{FixedPolynomialBasis{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}, Vector{MultivariatePolynomials.VectorPolynomial{ComplexF64, MultivariatePolynomials.Term{ComplexF64, CondensedMatterSOS.SpinMonomial}}}}}, itr::Base.Generator{Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, SumOfSquares.Certificate.Symmetry.var"#15#17"{ComplexF64, SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, SumOfSquares.Certificate.Symmetry._OrthogonalMatrix}}, st::Int64)
    @ Base ./array.jl:818
  [9] _collect(c::Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, itr::Base.Generator{Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, SumOfSquares.Certificate.Symmetry.var"#15#17"{ComplexF64, SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, SumOfSquares.Certificate.Symmetry._OrthogonalMatrix}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:812
 [10] collect_similar(cont::Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, itr::Base.Generator{Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}, SumOfSquares.Certificate.Symmetry.var"#15#17"{ComplexF64, SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, SumOfSquares.Certificate.Symmetry._OrthogonalMatrix}})
    @ Base ./array.jl:711
 [11] map(f::Function, A::Vector{SymbolicWedderburn.DirectSummand{ComplexF64, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}})
    @ Base ./abstractarray.jl:3263
 [12] _gram_basis(pattern::SumOfSquares.Certificate.Symmetry.Pattern{Lattice1Group, Action}, basis::MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}, #unused#::Type{ComplexF64})
    @ SumOfSquares.Certificate.Symmetry ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/wedderburn.jl:151
 [13] gram_basis
    @ ~/.julia/packages/SumOfSquares/Sin7c/src/Certificate/Symmetry/wedderburn.jl:126 [inlined]
 [14] bridge_constraint(#unused#::Type{SumOfSquares.Bridges.Constraint.SOSPolynomialBridge{ComplexF64, MathOptInterface.VectorAffineFunction{ComplexF64}, FullSpace, Union{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}}}, MathOptInterface.HermitianPositiveSemidefiniteConeTriangle, MathOptInterface.HermitianPositiveSemidefiniteConeTriangle, Vector{Vector{FixedPolynomialBasis}}, MonomialBasis, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, f::MathOptInterface.VectorAffineFunction{ComplexF64}, s::SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}})
    @ SumOfSquares.Bridges.Constraint ~/.julia/packages/SumOfSquares/Sin7c/src/Bridges/Constraint/sos_polynomial.jl:54
 [15] add_bridged_constraint(b::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, BridgeType::Type, f::MathOptInterface.VectorAffineFunction{ComplexF64}, s::SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}})
    @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/LQvlf/src/Bridges/bridge_optimizer.jl:1673
 [16] add_constraint(b::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, f::MathOptInterface.VectorAffineFunction{ComplexF64}, s::SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}})
    @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/LQvlf/src/Bridges/bridge_optimizer.jl:1748
 [17] _copy_constraints(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, index_map::MathOptInterface.Utilities.IndexMap, index_map_FS::MathOptInterface.Utilities.DoubleDicts.IndexDoubleDictInner{MathOptInterface.VectorAffineFunction{ComplexF64}, SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}}}, cis_src::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{ComplexF64}, SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/copy.jl:261
 [18] _copy_constraints(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, index_map::MathOptInterface.Utilities.IndexMap, cis_src::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{ComplexF64}, SumOfSquares.SOSPolynomialSet{FullSpace, CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}, SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/copy.jl:273
 [19] pass_nonvariable_constraints_fallback(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, index_map::MathOptInterface.Utilities.IndexMap, constraint_types::Vector{Any})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/copy.jl:284
 [20] pass_nonvariable_constraints(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, idxmap::MathOptInterface.Utilities.IndexMap, constraint_types::Vector{Any})
    @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/LQvlf/src/Bridges/bridge_optimizer.jl:441
 [21] _pass_constraints(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, index_map::MathOptInterface.Utilities.IndexMap, variable_constraints_not_added::Vector{Any})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/copy.jl:332
 [22] default_copy_to(dest::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/copy.jl:507
 [23] copy_to
    @ ~/.julia/packages/MathOptInterface/LQvlf/src/Bridges/bridge_optimizer.jl:451 [inlined]
 [24] optimize!
    @ ~/.julia/packages/MathOptInterface/LQvlf/src/MathOptInterface.jl:84 [inlined]
 [25] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Clarabel.MOImodule.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/LQvlf/src/Utilities/cachingoptimizer.jl:316
 [26] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JuMP ~/.julia/packages/JuMP/mvUVO/src/optimizer_interface.jl:439
 [27] optimize!
    @ ~/.julia/packages/JuMP/mvUVO/src/optimizer_interface.jl:409 [inlined]
 [28] energy(H::MultivariatePolynomials.VectorPolynomial{Complex{Int64}, MultivariatePolynomials.Term{Complex{Int64}, CondensedMatterSOS.SpinMonomial}}, maxdegree::Int64, solver::Type; cone::NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, sparsity::SumOfSquares.Certificate.Sparsity.Monomial{ClusterCompletion}, non_sparse::SumOfSquares.Certificate.MaxDegree{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis}, certificate::SumOfSquares.Certificate.Symmetry.Ideal{SumOfSquares.Certificate.FixedBasis{NonnegPolyInnerCone{MathOptInterface.HermitianPositiveSemidefiniteConeTriangle}, MonomialBasis{CondensedMatterSOS.SpinMonomial, Vector{CondensedMatterSOS.SpinMonomial}}}, Lattice1Group, Action}, kws::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ CondensedMatterSOS ~/.julia/dev/CondensedMatterSOS/src/sos.jl:37
 [29] energy
    @ ~/.julia/dev/CondensedMatterSOS/src/sos.jl:24 [inlined]
 [30] #hamiltonian_energy#3
    @ ~/.julia/dev/CondensedMatterSOS/examples/Benchmark_1.jl:36 [inlined]
 [31] macro expansion
    @ ./timing.jl:273 [inlined]
 [32] f(L::Int64, d::Int64, consecutive::Bool; symmetry::Bool)
    @ Main ~/.julia/dev/CondensedMatterSOS/examples/Benchmark_1.jl:109
 [33] f(L::Int64, d::Int64, consecutive::Bool)
    @ Main ~/.julia/dev/CondensedMatterSOS/examples/Benchmark_1.jl:105
 [34] top-level scope
    @ ~/.julia/dev/CondensedMatterSOS/examples/Benchmark_1.jl:128
 [35] include(fname::String)
    @ Base.MainInclude ./client.jl:478
 [36] top-level scope
    @ REPL[3]:1
in expression starting at /home/kalmar/.julia/dev/CondensedMatterSOS/examples/Benchmark_1.jl:128

@blegat ball is in your court ;)

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.37% ⚠️

Comparison is base (baa5b9a) 48.73% compared to head (96875ea) 48.37%.

Additional details and impacted files
@@              Coverage Diff              @@
##           bl/rename      #33      +/-   ##
=============================================
- Coverage      48.73%   48.37%   -0.37%     
=============================================
  Files              8        8              
  Lines            396      399       +3     
=============================================
  Hits             193      193              
- Misses           203      206       +3     
Files Changed Coverage Δ
src/CondensedMatterSOS.jl 62.50% <ø> (ø)
src/action.jl 0.00% <0.00%> (ø)
src/symmetry.jl 0.00% <0.00%> (ø)

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

@blegat blegat merged commit c518202 into blegat:bl/rename Sep 15, 2023
2 of 4 checks passed
blegat added a commit that referenced this pull request Sep 26, 2023
* Update to MP renamings

* Use MP#bl/rename

* Fixes

* Fixes

* Fix ci

* Remove Sequences

* Updates

* Fixes

* Fix doc script

* Checkout v3

* Fix

* Remove COI

* Update symmetric_group

* Fixes

* Fix

* Fixes

* rewrite the definitions of groups in symmetry.jl (#32)

* rewrite the definitions of groups in symmetry.jl

* add Random

* Update src/symmetry.jl

Co-authored-by: Marek Kaluba <[email protected]>

* Fixes

* fixes after the rewrite of symmetry.jl (#33)

* sort out deepcopy_internal stuff

* move imports/exports away from symmetry.jl

* update action.jl to the rewrite of symmetry.jl

* Fixes

* Use latest SOS

* Update GH action

---------

Co-authored-by: Marek Kaluba <[email protected]>
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.

2 participants