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

The value of the population is very small? #625

Closed
AtsushiTanimoto opened this issue Jul 10, 2023 · 5 comments
Closed

The value of the population is very small? #625

AtsushiTanimoto opened this issue Jul 10, 2023 · 5 comments

Comments

@AtsushiTanimoto
Copy link

Thank you for maintaining this nice code. To calculate the N04 population data, we have performed the following code. Although we could obtain the N04a_t00d0i2.sp file, the value of the population in the ground state was very small (~1.0e-5). How can we obtain realistic values for the population of the ground state?

import numpy
import pfac.fac
import pfac.spm
import subprocess


if __name__=="__main__":
    atomic_number   = 7
    electron_number = 4
    densities       = 1e-10*numpy.logspace(0, 0, 1)
    temperatures    = 1e+00*numpy.logspace(1, 1, 1)
    atomic_symbol   = pfac.fac.ATOMICSYMBOL[atomic_number]
    input_dir       = "database01/{0:s}/".format(atomic_symbol)
    output_dir      = "database01/{0:s}/{0:s}{1:02d}_spec/".format(atomic_symbol, electron_number)
    populations     = len(temperatures)*[(1+atomic_number)*[1.0]]
    subprocess.run("rm -r {0:s}".format(output_dir), shell=True)
    subprocess.run("mkdir {0:s}".format(output_dir), shell=True)
    pfac.spm.spectrum(neles=[electron_number], temp=temperatures, den=densities, population=populations, pref=atomic_symbol, dir0=input_dir, dir1=output_dir, nion=2, ai=1, ce=1, ci=1, rr=1, rrc=1)
@mfgu
Copy link
Collaborator

mfgu commented Jul 10, 2023

I am not able to reproduce the problem described. please post the exact steps you use in the calculation.

@AtsushiTanimoto
Copy link
Author

I am sorry for the lack of information. First, I calculated the basic atomic database of N03 and N04 by pfac.atom. I then computed the population data of N04 by pfac.spm. The Python code I ran is as follows. However, the obtained population value of the ground state in N04a_d00t00i2.sp is very small as shown below.

Environment:
Apple M1 Macbook Pro
macOS: Ventura 13.4.1
Python: Python 3.11.4

import numpy
import pfac.atom
import pfac.fac
import pfac.spm
import subprocess


if __name__=="__main__":
    atomic_number   = 7
    atomic_symbol   = pfac.fac.ATOMICSYMBOL[atomic_number]
    electron_number = 4
    densities       = 1e-10*numpy.logspace(1, 1, 1)
    temperatures    = 1e+00*numpy.logspace(1, 1, 1)
    populations     = len(temperatures)*[(1+atomic_number)*[1.0]]
    directory01     = "database/{0:s}/".format(atomic_symbol)
    directory02     = "database/{0:s}/".format(atomic_symbol)

    subprocess.run("mkdir {0:s}".format(directory01), shell=True)
    subprocess.run("mkdir {0:s}".format(directory02), shell=True)
    pfac.atom.atomic_data(nele=[electron_number-1, electron_number], asym=atomic_symbol, dir=directory01)
    pfac.spm.spectrum(neles=[electron_number], temp=temperatures, den=densities, population=populations, pref=atomic_symbol, dir0=directory01, dir1=directory02, nion=2, ai=1, ce=1, ci=1, rr=1, rrc=1)
FAC 1.1.5
Endian	= 0
TSess	= 1689041061
Type	= 7
Verbose	= 1
N Z	=   7.0
NBlocks	= 2319

NELE	= 4
NTRANS	= 1
TYPE	= 0000000
IBLK	= 6
ICOMP	= 1*2.2*2
FBLK	= 0
FCOMP	= 
     0      0  9.418330E+03  1.3418E-05  1.0000E+00  2.8015E-07

@mfgu
Copy link
Collaborator

mfgu commented Jul 11, 2023

i cannot reproduce the results with your script. the ground state population shows below in my run.
NELE = 4
NTRANS = 1
TYPE = 0000000
IBLK = 6
ICOMP = 12.22
FBLK = 0
FCOMP =
0 0 9.418330E+03 9.7816E-01 1.0000E+00 2.8015E-07

can you do two things.

  1. try update FAC to the current version on github. if you still get the same result,
  2. try to run the same script on a linux machine. maybe there is something peculiar about the apple M1/M2 chip, which I haven't had a chance to test.

@AtsushiTanimoto
Copy link
Author

AtsushiTanimoto commented Aug 1, 2023

Thank you for your reply.

Try updating FAC to the current version on github. if you still get the same result,

Two weeks ago I was using the latest version of the flexible atomic code.
Today I updated the flexible atomic code. As a result, I get the following segmentation fault. How can I work around this?

ATOM = N, Z = 7
EN...
Structure: ground complex
Structure: ionized complexes
    ['ion.0.0']
    ['ion.1.0']
    ['ion.2.0']
Structure: excited complexes
    ['exc.0.4.0']
    ['exc.0.5.0']
    ['exc.0.6.0']
    ['exc.0.7.0']
    (['ion.0.0'], 8)
zsh: segmentation fault  /opt/homebrew/bin/python3 spectrum.py

@mfgu
Copy link
Collaborator

mfgu commented Aug 1, 2023

The seg.fault. was recently introduced. the new update has the fix.

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