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

Weird issues with EuclideanMatrix property #104

Open
MatthiasSachs opened this issue Jan 11, 2022 · 3 comments
Open

Weird issues with EuclideanMatrix property #104

MatthiasSachs opened this issue Jan 11, 2022 · 3 comments

Comments

@MatthiasSachs
Copy link
Collaborator

MatthiasSachs commented Jan 11, 2022

Evaluations of a symmetric basis with property=EuclideanMatrix{Float64}

  1. are symmetric matrices as the passing of the following test shows
@info("Check for symmetry")
for ntest = 1:30
   local Xs, BB
   Xs = rand(PositionState{Float64}, B1p.bases[1], nX)
   BB = evaluate(basis, ACEConfig(Xs))
   print_tf(@test all([ b.val == transpose(b.val)
   for b in BB  ]))
end
println()
  1. have non-negligible complex components for basis functions of high degree as the passing of the following test shows
@info("Check magnitude of complex part")
for ntest = 1:30
   local Xs, BB
   Xs = rand(PositionState{Float64}, B1p.bases[1], nX)
   BB = evaluate(basis, ACEConfig(Xs))
   print_tf(@test all([ norm(complex(b)) < .1 
   for b in BB  ]))
end
println()

Both tests have been added to the test file test_EuclideanMatrix.jl in latest commit c7cdea1 to PR #99

@MatthiasSachs MatthiasSachs changed the title Weird issues EuclideanMatrix Weird issues with EuclideanMatrix property Jan 11, 2022
@MatthiasSachs
Copy link
Collaborator Author

MatthiasSachs commented Jan 11, 2022

I guess that issue 2 might be because of numerical error. But I find issue 1 to be more confusing? Where in the construction do we enforce symmetry of the matrix functions? Certainly, there are matrix functions that don't evaluate to symmetric matrices and at the same time satisfy the required equivariance property, e.g.,

$$M(r) = v_1(r) \otimes v_2(r),$$

where v_1 and v_2 are covariant matrix functions.

@cortner
Copy link
Member

cortner commented Jan 11, 2022

The symmetry issue suggests the basis is not complete.

@cortner
Copy link
Member

cortner commented Jan 11, 2022

The real/complex thing is weird. First though, note you shouldn't use complex but imag please.

But even then the test fails. In fact going back to this

φ = ACE.EuclideanMatrix(Float64)
pibasis = PIBasis(B1p, Bsel; property = φ)
basis = SymmetricBasis(φ, pibasis)
BB = evaluate(basis, cfg)

I don't understand at all why the elements of BB aren't real when you demand a real matrix as the property? Smells very much like a bug.

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

No branches or pull requests

2 participants