Skip to content

Get the eigenstate from PairStateInteractions.diagonalise #201

@yshen295

Description

@yshen295

Hi,
I have a problem about extracting the eigenstate after turning on sortEigenvectors=True, there will be an error ValueError: operands could not be broadcast together with shapes (432,250) (0,) . This is a toy model I build to find the eigenstate, and here is the code. Is there anything wrong with the library, or I was just not on the right track? Thanks!

def arc_eigenstate(a1,n1,a2,n2):
    if a1 == "Cs":
        atom1 = Caesium()
    elif a1 == "Rb":
        atom1 = Rubidium87()
    # n1 = 61
    l1 = 1
    j1 = 1.5
    m1 = 1.5
    if a2 == "Cs":
        atom2 = Caesium()
    elif a2 == "Rb":
        atom2 = Rubidium87()
    # n2 = 61
    l2 = 1
    j2 = 1.5
    m2 = 1.5
    

    Bz = 0.0001# #Tesla
    
    rmin = 1.5
    rmax = 6
    
    theta = 0 # Polar Angle [0-pi]
    phi = 0 # Azimuthal Angle [0-2pi]
    dn = 4 # Range of n to consider (n0-dn:n0+dn)
    dl = 4 # Range of l values
    deltaMax = 25e9  # Max pair-state energy difference [Hz]
    
    nEig = 250  # Number of eigenstates to extract
    
    
    calc = PairStateInteractions(atom1, n1, l1, j1, n2, l2, j2, m1, m2, s=0.5, 
                                 s2=0.5, atom2=atom2)
    
    r = np.linspace(rmin, rmax, 500)

    calc.defineBasis(theta, phi, dn, dl, deltaMax, Bz = Bz, 
                     progressOutput=True, debugOutput=False)
    
    calc.diagonalise(r, nEig, sortEigenvectors=True, progressOutput=True)
    
    i = np.argmin(np.abs(calc.r - 2.5))  # nearest to R = 5 μm
    

    #egvector = np.array(calc.composition)
    #print(egvector.shape)
    #for j in range(19):
       #print(egvector[i][j])
    R = 2.5  # Target distance            

    return

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions