diff --git a/gen_data.py b/gen_data.py index 7330c01801c3e30abfc052ad7aaeedfd2dd6abe8..09478ed17138b6f81b037150c691b7abf5afec08 100644 --- a/gen_data.py +++ b/gen_data.py @@ -216,7 +216,7 @@ python -m frtrg_kondo.gen_data \\ # Physical parameters phys_group = parser.add_argument_group(title="Physical parameters") - phys_group.add_argument("--omega", metavar='float', type=float, nargs='+', default=0., + phys_group.add_argument("--omega", metavar='float', type=float, required=True, nargs='+', help = "Frequency, units of Tkrg") phys_group.add_argument("--vdc", metavar='float', type=float, nargs='+', default=0., help="Vdc, units of Tkrg") @@ -236,17 +236,21 @@ python -m frtrg_kondo.gen_data \\ method_group = parser.add_argument_group(title="Method") method_group.add_argument("--method", type=str, required=True, choices=('J', 'mu'), help = "J: include all time dependence in coupling by unitary transformation.\nmu: describe time dependence by Floquet matrix for chemical potentials.") - method_group.add_argument("--simplified_initial_conditions", metavar="bool", type=bool, default=False, + method_group.add_argument("--simplified_initial_conditions", metavar="bool", + type=bool, default=False, help = "Set initial condition for gammaL to 0") - method_group.add_argument("--include_Ga", metavar="bool", type=bool, default=False, + method_group.add_argument("--include_Ga", metavar="int", type=int, + default=1, choices=(0,1), help = "include vertex parameter Ga in RG equations") - method_group.add_argument("--solve_integral_exactly", metavar="bool", type=bool, default=False, + method_group.add_argument("--solve_integral_exactly", metavar="bool", + type=bool, default=False, help = "Solve integral in RG equations exactly by diagonalizing Floquet matrices. Requires --integral_method") method_group.add_argument("--integral_method", metavar="int", type=int, default=-15, help = "Select solution/approximation of frequency integral") method_group.add_argument("--d", metavar='float', type=float, nargs='+', default=1e9, help = "D (UV cutoff), units of Tkrg") - method_group.add_argument("--resonant_dc_shift", metavar='int', type=int, nargs='+', default=0, + method_group.add_argument("--resonant_dc_shift", metavar='int', type=int, + nargs='+', default=0, help = "Describe DC voltage (partially) by shift in Floquet matrices. --vdc is the full voltage.") method_group.add_argument("--truncation_order", metavar="int", type=int, choices=(2,3), default=3, @@ -287,9 +291,9 @@ python -m frtrg_kondo.gen_data \\ # Convergence parameters concerning solver and D convergence solver_group = parser.add_argument_group("Solver") - solver_group.add_argument("--rtol", metavar="float", type=float, default=1e-7, + solver_group.add_argument("--rtol", metavar="float", type=float, default=1e-8, help = "Solver relative tolerance") - solver_group.add_argument("--atol", metavar="float", type=float, default=1e-9, + solver_group.add_argument("--atol", metavar="float", type=float, default=1e-10, help = "Solver relative tolerance") solver_group.add_argument("--solver_method", metavar="str", type=str, default="RK45", help = "ODE solver algorithm") diff --git a/plot_pyqtgraph.py b/plot_pyqtgraph.py index 0e6b92104d623f9d930b4c118c7bcd260cee442d..ad792772986bdf0332c99fb0b31206f1ebaac394 100644 --- a/plot_pyqtgraph.py +++ b/plot_pyqtgraph.py @@ -9,6 +9,7 @@ Kondo FRTRG, generate interactive plots using PyQtGraph import numpy as np import argparse from pyqtgraph.Qt import QtGui +from pyqtgraph.Qt.QtWidgets import QApplication from pyqtgraph import makeQImage import pyqtgraph.opengl as gl from matplotlib.pyplot import cm @@ -45,7 +46,7 @@ def full_overview(dm, assert plot_value in ("G", "gamma", "Iac", "Idc") data = dm.list(**parameters) data.sort_values("vac", inplace=True) - app = QtGui.QApplication([]) + app = QApplication([]) w = gl.GLViewWidget() w.show() w.setWindowTitle("Kondo model: Overview") @@ -105,7 +106,7 @@ def full_overview(dm, sp = gl.GLScatterPlotItem(pos=pos, size=size, color=cmap(values), pxMode=False) sp.setGLOptions(gl_preset) w.addItem(sp) - app.exec_() + app.exec() def fixed_parameter(dm, @@ -140,7 +141,7 @@ def fixed_parameter(dm, data_mirror.vdc *= -1 data = pd.concat((data, data_mirror)) del data_mirror - app = QtGui.QApplication([]) + app = QApplication([]) w = gl.GLViewWidget() w.show() w.setWindowTitle(f"Kondo model: fixed {parameter}") @@ -198,12 +199,12 @@ def fixed_parameter(dm, sp = gl.GLScatterPlotItem(pos=pos2, size=size, color=cmap(color_data), pxMode=False) sp.setGLOptions(gl_preset) w.addItem(sp) - app.exec_() + app.exec() def stacked_frequencies(dm, omegas=(7.1271, 16.5372), shift=2, scale=1, size=0.1, xyscale=None, zscale=None, grid=None, cmap="viridis", gl_preset=None, **parameters): parameters.pop("omega", None) - app = QtGui.QApplication([]) + app = QApplication([]) w = gl.GLViewWidget() w.show() w.setWindowTitle("Kondo model: stacked frequencies") @@ -219,7 +220,7 @@ def stacked_frequencies(dm, omegas=(7.1271, 16.5372), shift=2, scale=1, size=0.1 sp = gl.GLScatterPlotItem(pos=pos, size=size, color=cmap(data.dc_conductance*np.pi), pxMode=False) w.addItem(sp) plots.append(sp) - app.exec_() + app.exec() def vdc0_scaled(dm, @@ -239,7 +240,7 @@ def vdc0_scaled(dm, parameters.pop(name) cmap = cm.get_cmap(cmap) data = dm.list(vdc=0, **parameters) - app = QtGui.QApplication([]) + app = QApplication([]) w = gl.GLViewWidget() w.show() w.setWindowTitle(f"Kondo model: Vdc=0") @@ -261,7 +262,7 @@ def vdc0_scaled(dm, pxMode=False) sp.setGLOptions(gl_preset) w.addItem(sp) - app.exec_() + app.exec() def plot_interpolated( @@ -280,7 +281,7 @@ def plot_interpolated( #data = np.genfromtxt("figdata/vdc_vac_omega16.5372_interp.dat", names=True, delimiter=",") #data = np.load("figdata/vdc_vac_omega16.5372_interp.npz") data = np.load("figdata/omega5_interp.npz") - app = QtGui.QApplication([]) + app = QApplication([]) w = gl.GLViewWidget() w.show() #pos = np.array([*np.meshgrid(data["vdc"], data["vac"]), 50*data["gdc_g"]]).reshape((3,-1)).T @@ -339,7 +340,7 @@ def plot_interpolated( w.opts["center"] = QtGui.QVector3D(0,40,-150) arr = w.renderToArray((1000,800)).transpose((1,0,2)) makeQImage(arr).save(f"/tmp/Goverview_{method}_{order}.png") - app.exec_() + app.exec() #w.grabFrameBuffer().save('/tmp/test.png') @@ -433,7 +434,7 @@ def plot_convergence(dm, if size is None: size = 1. fitted_data, data = convergence_grid_data(dm) - app = QtGui.QApplication([]) + app = QApplication([]) cmap = cm.get_cmap(cmap) data_convergence = data.loc[ (data.method=="mu") @@ -547,7 +548,7 @@ def plot_convergence(dm, sp.setGLOptions(gl_preset) w_iac.addItem(sp) - app.exec_() + app.exec() def compare_orders(dm, @@ -578,7 +579,7 @@ def compare_orders(dm, on=["vdc","vac","d","omega","method","solver_tol_rel","solver_tol_abs","resonant_dc_shift","padding","energy_im","energy_re","xL","lazy_inverse_factor"], suffixes=("_2", "_3")) - app = QtGui.QApplication([]) + app = QApplication([]) w_g = gl.GLViewWidget() w_g.show() rel_diff = (merged.dc_conductance_2 - merged.dc_conductance_3) / merged.dc_conductance_3 @@ -591,7 +592,7 @@ def compare_orders(dm, #pos = np.array([merged.vdc, merged.vac, 150*np.pi*merged.dc_conductance_3]).T sp = gl.GLScatterPlotItem(pos=pos, size=1, color=colors, pxMode=False) w_g.addItem(sp) - app.exec_() + app.exec() def compare_extra_precise(dm, @@ -632,7 +633,7 @@ def compare_extra_precise(dm, on=["vdc","vac","d","omega","method","solver_tol_rel","solver_tol_abs","resonant_dc_shift","padding","energy_im","energy_re","xL","lazy_inverse_factor"], suffixes=("_s", "_p")) - app = QtGui.QApplication([]) + app = QApplication([]) w_g = gl.GLViewWidget() w_g.show() rel_diff = (merged.dc_conductance_s - merged.dc_conductance_p) / merged.dc_conductance_p @@ -645,7 +646,7 @@ def compare_extra_precise(dm, pos = np.array([merged.vdc, merged.vac, 150*np.pi*merged.dc_conductance_p]).T sp = gl.GLScatterPlotItem(pos=pos, size=size, color=colors, pxMode=False) w_g.addItem(sp) - app.exec_() + app.exec() def compare_RGeq(dm, @@ -676,7 +677,7 @@ def compare_RGeq(dm, & (data.integral_method == -1) pos = np.array([data.vdc, data.vac, scale*data.dc_conductance]).T - app = QtGui.QApplication([]) + app = QApplication([]) w_g = gl.GLViewWidget() w_g.show() sp = gl.GLScatterPlotItem(pos=pos[order2], size=size, color=(1,0,0,1), pxMode=False) @@ -685,7 +686,7 @@ def compare_RGeq(dm, w_g.addItem(sp) sp = gl.GLScatterPlotItem(pos=pos[order3plus], size=size, color=(0,1,0,1), pxMode=False) w_g.addItem(sp) - app.exec_() + app.exec() PRESETS = dict(