Module: Plots
Module: Plots
This module provides ready-to-go functions for plotting. Probably should be moved and work as a script.
List of functions
- libnest.plots.plot_energy_per_nucleon(rho_n, rho_p)[source]
Plots the energy per nucleon for uniform matter of density \(\rho\), the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively.
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_energy_per_nucleon_both()[source]
Plots the energy per nucleon for symmetric uniform matter and neutron uniform matter of density \(\rho\), which is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively.
- Parameters:
None
- Returns:
None
See also
- libnest.plots.plot_pairing_field_n(rho_n, rho_p)[source]
Plots the pairing field \(\Delta\) [MeV] for neutrons in matter of density \(\rho\), the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively.
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_pairing_field_p(rho_n, rho_p)[source]
Plots the pairing field \(\Delta\) [MeV] for protons in matter of density \(\rho\), the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively.
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_effective_mass_n(rho_n, rho_p)[source]
Plots the effective mass of neutron, \(M_{n}^{*} / M\) [MeV] in matter of density \(\rho\). \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively, and \(M\) is the sum of neutron and proton masses.
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_effective_mass_p(rho_n, rho_p)[source]
Plots the effective mass of proton, \(M_{p}^{*}/ M\) [MeV] in matter of density \(\rho\). \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\) respectively, and \(M\) is the sum of neutron and proton masses.
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_B_q(rho_n, rho_p, q)[source]
Plots the mean field potential (from variation over kinetic density, or effective mass), \(B_{q}\) [MeV fm 2], in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_U_q(rho_n, rho_p, q)[source]
Plots the mean field potential (from variation over density \(\rho\)), \(U_{q}\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_isoscalarM(rho_n, rho_p)[source]
Plots the isoscalar effective mass, \(M_s^*\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_isovectorM(rho_n, rho_p)[source]
Plots the isovector effective mass, \(M_v^*`\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- Parameters:
- Returns:
None
See also
- libnest.plots.plot_pressure_n(rho_n)[source]
Plots pressure \(P\) inside NeuM of density \(rho_n\) in units of percentage of speed of sound.
- Parameters:
rho_n (float) – maximum neutron density \(\rho_n\) [fm -3]; sum of both spin components
- Returns:
None
See also
- libnest.plots.plot_speed_of_sound_n(rho_n)[source]
Plots the speed of sound for NeuM of density \(rho_n\) in units of percentage of speed of sound.
- Parameters:
rho_n (float) – maximum neutron density \(\rho_n\) [fm -3]; sum of both spin components
- Returns:
None
See also
- libnest.plots.plot_v_landau(rho_n)[source]
Plots the Landau velocity, which shows at which velocity the superfluid medium starts to become excited, for neutron matter of density \(\rho_n\).
\[v_L = \frac{\Delta}{\hbar k_F} c\]- Parameters:
rho_n (float) – maximum neutron density \(\rho_n\) [fm -3]; sum of both spin components
- Returns:
None
- libnest.plots.plot_v_critical(rho_n)[source]
Plots the critical velocity for a superfluid.
\[v_L = e \frac{\Delta}{\hbar k_F} c \]- Parameters:
rho_n (float) – maximum neutron density \(\rho_n\) [fm -3]; sum of both spin components
- Returns:
None
See also
- libnest.plots.plot_v_sf(r)[source]
Plots the superfluid velocity \(v_{sf}\) based on the gradient of the pairing field gradient.
\[v_\mathrm{sf} = \frac{\hbar c}{M} \frac{1}{2r}\]- Parameters:
r (float) – distance from the center of a vortex \(r\) [fm]
- Returns:
None
See also
- libnest.plots.plot_epsilon(rho_n, rho_p, rho_grad, tau, j, nu, q, kappa)[source]
Plots the energy density \(\epsilon\) [MeV fm -3] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- Parameters:
rho_n (float) – neutron density \(\rho_n\) [fm -3]; sum of both spin components
rho_p (float) – proton density \(\rho_p\) [fm -3]; sum of both spin components
rho_grad (float) – particle density gradient \(\nabla \rho\) [fm -4]
tau (float) – kinetic density \(\tau\) [fm -5]
j (float) – momentum density/current \(j\) [fm -3]
nu (float) – anomalous density \(\nu\) [fm -3]
q (str) – nucleon type choice (‘p’ - proton, or ‘n’ - neutron)
kappa (float) – what is kappa? (no Eq.9 in Ref.41)
- Returns:
None
See also
- libnest.plots.plot_epsilon_tau(rho_n, rho_p, tau, j)[source]
Plots the energy density \(\epsilon\) [MeV fm -3] in neutron matter, related to the density-dependent effective mass.
- libnest.plots.plot_epsilon_delta(rho_n, rho_p, rho_grad)[source]
Plots the isovector effective mass, \(M_v^*`\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- libnest.plots.plot_epsilon_rho_np(rho_n, rho_p)[source]
Plots the isovector effective mass, \(M_v^*`\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- libnest.plots.plot_epsilon_tau_np(rho_n, rho_p, tau_n, tau_p, jsum2, jdiff2)[source]
Plots the isovector effective mass, \(M_v^*`\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- libnest.plots.plot_epsilon_delta_rho_np(rho_n, rho_p, rho_grad_n, rho_grad_p, rho_grad)[source]
Plots the isovector effective mass, \(M_v^*`\) [MeV] in matter of density \(\rho\), where \(\rho\) is the sum of proton and neutron densities, \(\rho_p\) and \(\rho_n\).
- libnest.plots.epsilon_test(rho_n, rho_p, rho_grad_n, rho_grad_p, tau_n, tau_p, jsum2, jdiff2)[source]
Plots the energy density functional from bsk_functional_full code (for testing).
- Parameters:
rho_n (float) – neutron density \(\rho_n\) [fm -3]; sum of both spin components
rho_p (float) – proton density \(\rho_p\) [fm -3]; sum of both spin components
rho_grad_n (float) – neutron density gradient \(\nabla \rho\) [fm -4]
rho_grad_p (float) – proton density gradient \(\nabla \rho\) [fm -4]
tau_n (float) – kinetic density \(\tau\) [fm -5]
tau_n – kinetic density \(\tau\) [fm -5]
jsum2 (float) – sum of momentum density/current vectors \(j\) [fm -3]
jdiff2 (float) – difference of momentum density/current vectors \(j\) [fm -3]
- Returns:
None
- libnest.plots.plot_epsilon_np(rho_n, rho_p, rho_grad_n, rho_grad_p, tau_n, tau_p, jsum2, jdiff2, nu_n, nu_p, kappa_n, kappa_p)[source]
Plots the energy functional \(\epsilon\) [MeV fm -3] against :math`rho`, the sum of proton and neutron of densities, \(\rho_p\) and \(\rho_n\) respectively.
- Parameters:
rho_n (float) – neutron density \(\rho_n\) [fm -3]; sum of both spin components
rho_p (float) – proton density \(\rho_p\) [fm -3]; sum of both spin components
rho_grad_n (float) – neutron density gradient \(\nabla \rho\) [fm -4]
rho_grad_p (float) – proton density gradient \(\nabla \rho\) [fm -4]
tau_n (float) – kinetic density \(\tau\) [fm -5]
tau_n – kinetic density \(\tau\) [fm -5]
jsum2 (float) – sum of momentum density/current vectors \(j\) [fm -3]
jdiff2 (float) – difference of momentum density/current vectors \(j\) [fm -3]
nu_n (float) – neutron anomalous density \(\nu\) [fm -3]
nu_p (float) – proton anomalous density \(\nu\) [fm -3]
kappa_n (float)
kappa_p (float)
- Returns:
None
Plotting real data
This module…
List of functions
- libnest.real_data_plots.file_check(filename)[source]
Checks if all files are present in the directory.
- Parameters:
filename (str) – name of the data set file
- Raises:
- Returns:
bool
- libnest.real_data_plots.files_set_particles(particles_nr, directory_path)[source]
Returns an array with files containing data sets only for a specified number of particles.
Args: particles_nr (str): number of particles of the data set
- Returns
array: list of filenames
- libnest.real_data_plots.files_set_type(data_type, filenames)[source]
Takes an array of files and returns an array with files containing data sets of a specified kind: rho (matter density), current, delta (pairing field), or A (mean field potential)
Args: data_type (str): choice of type of files filenames (array): list of filenames to sort through
- Returns
array: list of filenames of a specified kind
- libnest.real_data_plots.file_andreev(filenames)[source]
Returns the name of the file with Andreev states that matches a data set.
- libnest.real_data_plots.andreev_e_minimum(filename)[source]
Returns the minigap energy read from a file with Andreev states: the lowest energy of the states whose angular momenta \(L_z\) of the u and v components differ by one.
- libnest.real_data_plots.cross_section_distance(x, y, size)[source]
Returns the distance to the centre of the 90x90 fm box as cross-section, changing it from a coordinate system with origin at one corner of the box.
- Args:
x (float): x-coordinate of \(r\) [fm] y (float): y=coordinate of \(r\) [fm] size (float): full size of one axis of the square/box [fm]
- Returns:
cross section distance \(r\) [fm]
- Return type:
- libnest.real_data_plots.phi(x, y, size)[source]
Returns the angle of the line connecting the coordinates to the centre of the 90x90 “box”, for a coordinate system with origin at a corner of the box.
- Args:
x (float): x-coordinate \(r\) [fm] y (float): y=coordinate \(r\) [fm] size (float): full size of one axis of the square/box [fm]
- Returns:
angle \(\phi\) [rad]
- Return type:
- libnest.real_data_plots.pairing_field(rel, im)[source]
Calculates the absolute value/modulus and the argument of the field potential from its imaginary and real parts.
- libnest.real_data_plots.vector_magnitude(x, y, z)[source]
Calculates the magnitude of a vector with its vector x, y, and z components.
- libnest.real_data_plots.jsum2(i_x, i_y, i_z, j_x, j_y, j_z)[source]
Sum of of currents \(\vec i\) and \(\vec j\), squared.
- Parameters:
- Returns
float: squared sum of currents, \((\vec i + \vec j)^2\)
- libnest.real_data_plots.jdiff2(i_x, i_y, i_z, j_x, j_y, j_z)[source]
Difference of currents \(\vec i\) and \(\vec j\), squared.
- Parameters:
- Returns
float: squared difference of currents \((\vec j - \vec j)^2\)
- libnest.real_data_plots.plot_density(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the density \(\rho\) [fm -3].
Cross section distance is calculated and the density is divided by bulk density. The ratio is plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_density_contour(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the density \(\rho\) [fm -3].
//A grid is created and populated using triangulation (“scipy.interpolate.triangulate”). A contour plot of density as a vertical cross section is created.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
- libnest.real_data_plots.plot_pairing_field(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the real part of the pairing field \(\Delta_{rel}\) [MeV] and the fourth is the imaginary part of the pairing field \(\Delta_{im}\) [MeV].
Cross section distance and the total pairing field are calculated. The total pairing field is divided by the bulk pairing field, and the ratio is plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_current(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third, fourth, and fifth columns are \(\vec x\), \(\vec y\), \(\vec z\) current components [fm -4]
Cross section distance and the total current vector \(\vec j\) are calculated. The current is then plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_density_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the density \(\rho\) [fm -3].
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_current_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third, fourth, and fifth columns are \(\vec x\), \(\vec y\), \(\vec z\) current components [fm -4]
Cross section distance and the total current vector \(\vec j\) are calculated. The current is then plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_pairing_field_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the real part of the pairing field \(\Delta_{rel}\) [MeV] and the fourth is the imaginary part of the pairing field \(\Delta_{im}\) [MeV].
Cross section distance and the total pairing field \(\Delta\) are calculated and plotted against each other.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_B_q_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the density \(\rho\) [fm -3].
Cross section distance and the mean field potential B_q, coming from the variation over kinetic density, \(B_q\), are calculated. \(B_q\) is then plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_U_q_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third column is the real part of the pairing field \(\Delta_{rel}\) [MeV] and the fourth is the imaginary part of the pairing field \(\Delta_{im}\) [MeV].
Cross section distance and the mean field potential from density \(\rho\) variation, \(U_q\), are calculated. \(U_q\) is plotted against the cross section distance.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_A_slice(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first and second columns are x- and y-coordinates. The third, fourth, and fifth columns are the x, y, and z components of the mean-field potential vector \(A\). The field is defined as the variation over thee components of the current j.
Cross section distance is calculated and the resulting \(A\) is plotted against it.
- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_v_sf_real(filename)[source]
Opens the specified file, checks its validity, and creates a 2D array from its data. The first two columns are the x and y coordinates, which are then used to calculate the superfluid velocity \(v_{sf}\) [c] based on the gradient of the pairing field gradient.
It is then plotted as a cross section through the ‘box’ containing the vortex/uniform matter data.
\[v_\mathrm{sf} = \frac{\hbar c}{M} \frac{1}{2r}\]- Parameters:
filename (str) – name of the data set file
- Returns:
None
See also
- libnest.real_data_plots.plot_vsf_nv(filename_density, filename_A, filename_current)[source]
Opens the specified files containing density, mean field potential from current variation, and current data. The code checks their validity, and creates three 2D data arrays. It calculates superfluid velocity \(v_{sf}_{NV}\) [c] based on the gradient of the pairing field phase. It is adjusted to the entrainment effects (definition by Nicolas Chamel Valentin Allard). It also calculates the velocity (mass velocity) \(v_{NV}\) [c], also adjusted to the entrainment effects.
Both velocities are plotted as a cross section through the ‘box’ containing the vortex/uniform matter data.
\[v^{\mathrm{NV}} = \hbar c \frac{\hbar^2}{2 M B} \frac{{ j}}{\rho} + \frac{{ A}}{M}\]\[v_\mathrm{sf}^{NV} = \frac{\hbar^2}{2 M B}v_\mathrm{sf} + \frac{{ A}}{M}\]
- libnest.real_data_plots.plot_landau_velocity(filename_density, filename_delta)[source]
Opens the specified files containing density and reference field data. The code checks their validity, and creates 2D data arrays. It calculates the Landau velocity \(v_{Landau}\) [c], which shows at which velocity the superfluid medium starts to be excited.
It is plotted as a cross section through the ‘box’ containing the vortex/uniform matter data.
\[v_L = \frac{\Delta}{\hbar k_F} c\]- Parameters:
- Returns:
None
See also
- libnest.real_data_plots.plot_landau_velocity_temperature(particles_nr)[source]
Plots the mean value of Landau velocity \(v_{Landau}\) [c] against temperature T [MeV/k:sub:B].The code uses
files_set_type()andfiles_set_particles()functions to parse through the data and chose only files with pairing field, and density data sets for the chosen number of particles (respectively). It does so for vortex data and for uniform matter data for comparison.The function creates an array of temperatures (taken from filenames) and goes through the files to find the mean \(v_{Landau} [c]\) in the range of 40-60 fm (which is assumed to be the flattest part of the curve). The speed of sound \(v_s\) [c] is also calculated analytically from the vortex data.
A plot of \(v_{s}\), and \(v_{Landau}\) for vortex and uniform matter against temperature is created.
- Parameters:
particles_nr (str) – choice of files with a specified number of particles
- Returns
None
See also
- libnest.real_data_plots.plot_landau_critical_velocity(filename_density, filename_delta)[source]
Opens the specified files containing density and reference field data. The code checks their validity, and creates 2D data arrays. It calculates the Landau velocity \(v_{Landau}\) [c], which shows at which velocity the superfluid medium starts to be excited, and the critical velocity, \(v_{Critical}\) [c] (at this velocity the system is no longer superfluid). Both velocities are plotted as a cross section through the ‘box’ containing the vortex/uniform matter data.
\[v_L = \frac{\Delta}{\hbar k_F} c\]\[v_L = e \frac{\Delta}{\hbar k_F} c \]- Parameters:
- Returns:
None
See also
- libnest.real_data_plots.plot_speed_of_sound(filename_density)[source]
Opens the specified files containing the density data for NeuM. The code checks its validity, and creates a 2D data array. It calculates the speed of sound \(v_{s}\) [c], and plots it against a cross section through the ‘box’ containing the vortex/uniform matter data.
- Parameters:
filename_density (str) – name of the file containing density data
- Returns:
None
See also
- libnest.real_data_plots.plot_e_minigap(filename_density)[source]
Opens the specified files containing the density data for NeuM. The code checks its validity, and creates a 2D data array. It calculates the energy of minigap \(E_{minigap}\), and plots it against a cross section through the ‘box’ containing the vortex/uniform matter data.
- Parameters:
filename_density (str) – name of the file containing density data
- Returns:
None
See also
- libnest.real_data_plots.plot_e_minigap_temperature(particles_nr)[source]
Plots the maximum value the energy of minigap \(E_{minigap}\) [MeV] against temperature T [MeV/k:sub:B].The code uses
files_set_type()andfiles_set_particles()functions to parse through the data and chose only files with, (respectively), pairing field, and density data sets for the chosen number of particles. It does so for vortex data and for uniform matter data for comparison.The function creates an array of temperatures (taken from filenames) and goes through the files to find the mean \(v_{Landau} [c]\) in the range of 40-60 fm (which is assumed to be the flattest part of the curve).
The function accesses also data with Andreev states simulation for the specified number of particles and finds their minimum \(E_{minigap}\) data point. It is then plotted as a striaght line for comparison.
- Parameters:
particles_nr (str) – choice of files with a specified number of particles
- Returns
None