Data output files


Is there an easy way to obtain .dat/.txt files when using “amset plot xxx.json”, in addition to obtain the pdf/png file? In a similar way, as one can use the ‘–gnuplot’ tag in phonopy?

Thank you in advance!
Kind regards,
Simon Mellaerts

Hi Simon,

This isn’t currently available but I’ve added this as a feature request to the GitHub tracker. I will update this thread once this it implemented.


1 Like

I’ve added a --gnuplot option to the transport plotter (i.e., amset plot transport transport.json --gnuplot) that writes basic data files. Multiple files are written for each subplot. For example, there are separate files for the conductivity, Seebeck coefficient etc.

The files look like:

# File generated using amset 0.4.5
# x-axis: Temperature (K)
# y-axis: Conductivity (S/m)
# temperature  $n_e$=3.00$\times$10$^{13}$cm$^{-3}$
2.01000000e+02 6.18900318e+00
2.90000000e+02 4.54587362e+00
4.01000000e+02 3.30730120e+00
5.06000000e+02 2.56385648e+00
6.05000000e+02 2.30912218e+00
7.89000000e+02 1.96701699e+01
9.94000000e+02 1.60042054e+02

The first column is the x-axis data, subsequent columns are for each doping concentrations/temperatures (i.e., each line has a separate column).

Currently this is only enabled for the transport plotter. If you have another plotter you’d like me to add it to please let me know.

Thank you very much Alex! I really appreciate all the effort for this great code!

Best regards,

Dear Alex,

Could you please also give mobility.dat using the same process? Thank you very much!

Best wishes,

I seem to understand that you make an average of three diagonal values since the off-diagonal are zero. Is it correct? Thanks a lot!

Best wishes,

The averaged mobility values are obtained from the average of the eigenvalues of the mobility tensor.

I will look into adding the --gnuplot option to amset plot mobility also.

Maybe it’s better to include it for amset plot rates? Because you can already obtain mobility from “amset plot transport --mobility --gnuplot transport.json”.

Kind regards,

Thanks Simon and Alex. It will make amset more decent to save data and plot.

Best wishes,

Dear Alex,

Do you still plan to add --gnuplot to amset plot mobiltiy so that you have the .dat file of the mobility with the different contributions? We would really like to have some .dat files to finish some figures for one of our manuscripts.

Thank you very much!
Kind regards,

Hi Simon,

I’ve not had a chance to implement this yet. I can look at getting it done early next week.

In the meantime, have you tried using the transport.json file? It contains all the transport information needed to plot. For example, if you want the mobility limited by different scattering mechanisms you get them using:

import json
import numpy as np
from amset.util import tensor_average

with open("transport_x_y_z.json"): as f
    transport = json.load(f)

temperatures = transport["temperatures"]
doping = transport["doping"]

# full list of scatterers included is given by

mob_total = np.array(transport["mobility"]["overall"])
mob_adp = np.array(transport["mobility"]["ADP"])

# transport given as a numpy array with the shape
# (n_doping, n_temperatures, 3, 3)
# to get the averaged values of transport you can do
mob_adp_avg = tensor_average(mob_adp)

# this array now has the shape (n_doping, n_temperatures)

# i.e., to plot carrier concentration against mobility for the first
# temperature
import matplotlib.pyplot as plt

plt.plot(doping, mob_adp_avg[:, 0])


1 Like