Giter VIP home page Giter VIP logo

Comments (6)

clwainwright avatar clwainwright commented on July 17, 2024

It's bit hard to tell what the problem would be without a fuller description. Could you provide code that will reproduce the error?

from cosmotransitions.

phase-tr avatar phase-tr commented on July 17, 2024

Dear Carroll,
Thank your for your reply. In the testModel.py, I add the third field.
The main modifications include
self.Ndim = 3
def boson_massSq(self, X, T):
X = np.array(X)
phi1,phi2,phi3 = X[...,0], X[...,1], X[...,2]
m11 = self.l1*(3phi1phi1 - v2)
m22 = self.l2*(3phi2phi2 - v2)
m33 = 0.5phi3phi3
m12= self.l1phi1phi2
m13 = self.l1phi1phi3
m23 =self.l2phi2phi3
mm=np.array([[m11,m12,m13],[m12,m22,m23],[m13,m23,m33]])
print("matrix:", mm)
valm, vecm= np.linalg.eig(mm)
print("eiganvalue:", valm)
print("---------")
M = np.array([valm[0], valm[1], valm[2]])
M = np.rollaxis(M, 0, len(M.shape))
dof = np.array([1, 1, 1])
c = np.array([1.5, 1.5, 1.5])
return M, dof, c
def approxZeroTMin(self):
v = v2**.5
return [np.array([v,v,0]), np.array([v,-v,0])]

The output:

matrix: [[ 15907.29585374 9072.69610265 17228.41322886]
[ 9072.69610265 4316.00547642 3523.15126973]
[ 17228.41322886 3523.15126973 161946.06943183]]
eiganvalue: [ 164080.8897684 18922.33933215 -833.85833856]

Tracing phase starting at x = [ 254.44037152 299.71222224 569.13343481] ; t = 0.0
Tracing minimum up
traceMinimum t0 = 0
matrix: [[[ 15907.2759916 15907.45762553 15907.63926018 15907.82089554
15908.00253162]
[ 9072.96725197 9073.00291077 9073.03856957 9073.07422837
9073.10988717]
[ 17228.95708893 17229.02480261 17229.09251628 17229.16022996
17229.22794363]]

[[ 9072.96725197 9073.00291077 9073.03856957 9073.07422837
9073.10988717]
[ 4316.34296063 4316.34296063 4316.34296063 4316.34296063
4316.34296063]
[ 3523.37081309 3523.37081309 3523.37081309 3523.37081309
3523.37081309]]

[[ 17228.95708893 17229.02480261 17229.09251628 17229.16022996
17229.22794363]
[ 3523.37081309 3523.37081309 3523.37081309 3523.37081309
3523.37081309]
[ 161956.43331001 161956.43331001 161956.43331001 161956.43331001
161956.43331001]]]

The reported error:
raise LinAlgError('Last 2 dimensions of the array must be square')
numpy.linalg.linalg.LinAlgError: Last 2 dimensions of the array must be square

from cosmotransitions.

phase-tr avatar phase-tr commented on July 17, 2024

testModel.py.gz

from cosmotransitions.

mamerchandmedi avatar mamerchandmedi commented on July 17, 2024

were you able to solve this issue? I am having a similar complicatioon with a many scalar field model.

from cosmotransitions.

subhojitphy avatar subhojitphy commented on July 17, 2024

Dear All,

I used np.linalg.eig(array_name) for the diagonalization of a (3x3) field-dependent mass matrix and encountered the following error:
"LinAlgError: Last 2 dimensions of the array must be square",
which is similar to the above mentioned issue.

How did you solve this problem? what did you use to get the eigenvalues?

Many thanks in advance.

from cosmotransitions.

subhojitphy avatar subhojitphy commented on July 17, 2024

Solved.

from cosmotransitions.

Related Issues (20)

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.