Ksat-Qsat correlation

3.1. Ksat-Qsat correlation#

In this tutorial, you will learn how to extract the Ksat-Qsat correlation.


Import the libraries that will be employed in this tutorial.

# Import numpy
import numpy as np
# Import matplotlib
import matplotlib.pyplot as plt
# Import nucleardatapy package
import nucleardatapy as nuda

You can simply print out the properties of the nuda’s function that we will use:

# Explore the nucleardatapy module to find the correct attribute
print(dir(nuda.corr.setupKsatQsat))
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'init_self', 'print_outputs']

Get the full list of constraints:

print('models:',nuda.corr.KsatQsat_constraints()[0])
models: ['1991-Pearson', '2025-MK-95', '2025-MK-90', '2025-MK-67', 'EDF-SKY', 'EDF-GSKY', 'EDF-ESKY', 'EDF-Fayans', 'EDF-Gogny', 'EDF-DDRH', 'EDF-NLRH', 'EDF-DDRHF', 'EDF-xEFT']

Fix one model for which we want to extract the constraint:

constraint = '2024-DFT-SKY'
kq = nuda.corr.setupKsatQsat( constraint = constraint )
setup_KsatQsat: The constraint  2024-DFT-SKY  is not in the list of constraints.
setup_KsatQsat: list of constraints: ['1991-Pearson', '2025-MK-95', '2025-MK-90', '2025-MK-67', 'EDF-SKY', 'EDF-GSKY', 'EDF-ESKY', 'EDF-Fayans', 'EDF-Gogny', 'EDF-DDRH', 'EDF-NLRH', 'EDF-DDRHF', 'EDF-xEFT']
setup_KsatQsat: -- Exit the code --
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[4], line 2
      1 constraint = '2024-DFT-SKY'
----> 2 kq = nuda.corr.setupKsatQsat( constraint = constraint )

File ~/work/nucleardatapy/nucleardatapy/version-1.0/nucleardatapy/corr/setup_KsatQsat.py:62, in setupKsatQsat.__init__(self, constraint)
     60     print('setup_KsatQsat: list of constraints:',constraints)
     61     print('setup_KsatQsat: -- Exit the code --')
---> 62     exit()
     63 #
     64 if constraint.lower() == '1991-pearson':
     65     #
     66     # pearson correlation
     67     #
     68     #: Attribute providing the label the data is references for figures.

NameError: name 'exit' is not defined

print the outputs:

kq.print_outputs()
   constraint: 2024-DFT-SKY
   ref: 
   label: Skyrme-2024
   note: constraints from Skyrme DFT.
   plot: None
   Ksat: [239.3441, 241.6726, 241.6857, 241.6553, 230.0156, 230.0252, 230.0084, 217.0589, 210.7857, 244.224, 240.245, 225.6646, 239.5167, 245.005, 214.651, 355.3754, 237.2519, 240.7237, 247.7449, 230.8828, 223.3613, 222.3165, 201.0341, 237.3913, 271.0816, 230.1072, 229.9148, 229.9628, 229.9107, 229.9151, 305.6799, 235.9693, 230.0255, 230.0195, 220.0152]
   Qsat: [-358.6562, -363.5624, -363.5954, -363.5079, -404.9084, -406.1566, -405.4248, -399.4512, -382.5238, -324.63, -316.0942, -362.5279, -349.8086, -338.6849, -380.8947, 101.3885, -348.7068, -339.2832, -330.7994, -338.0346, -392.8599, -390.7309, -435.5587, -348.3948, -297.4161, -365.2347, -363.0842, -363.973, -364.1825, -363.0837, -175.76, -383.1506, -365.9015, -403.6671, -404.1833]

plot:


constraints, constraints_lower = nuda.corr.KsatQsat_constraints()
print('constraints:',constraints)
constraints: ['2024-DFT-SKY', '2024-DFT-SKY2', '2024-DFT-ESKY', '2024-DFT-DDRH', '2024-DFT-NLRH', '2024-DFT-DDRHF', '2024-DFT-Fayans', '2024-DFT-Gogny']

nuda.fig.corr_setupKsatQsat_fig( pname=None, constraints = constraints )
Plot name: None
constraint: 2024-DFT-SKY
constraint: 2024-DFT-SKY2
constraint: 2024-DFT-ESKY
constraint: 2024-DFT-DDRH
constraint: 2024-DFT-NLRH
constraint: 2024-DFT-DDRHF
constraint: 2024-DFT-Fayans
constraint: 2024-DFT-Gogny
../../_images/583208ba5ae701ec6a0582796a525b2aa5d75d5ef37ba7dffffe514e96ae87c7.png