qDNA 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. configs/__init__.py +0 -0
  2. configs/config.yaml +45 -0
  3. data/__init__.py +0 -0
  4. data/raw/__init__.py +0 -0
  5. data/raw/tb_params/Hawke2010_electron_ELM.json +1 -0
  6. data/raw/tb_params/Hawke2010_electron_LM.json +1 -0
  7. data/raw/tb_params/Hawke2010_electron_WM.json +1 -0
  8. data/raw/tb_params/Hawke2010_hole_ELM.json +1 -0
  9. data/raw/tb_params/Hawke2010_hole_FWM.json +1 -0
  10. data/raw/tb_params/Hawke2010_hole_LM.json +1 -0
  11. data/raw/tb_params/Hawke2010_hole_WM.json +1 -0
  12. data/raw/tb_params/Mantela2021_electron_WM.json +1 -0
  13. data/raw/tb_params/Mantela2021_hole_WM.json +1 -0
  14. data/raw/tb_params/Simserides2014_electron_WM.json +1 -0
  15. data/raw/tb_params/Simserides2014_hole_WM.json +1 -0
  16. data/raw/tb_params/Simserides2024_electron_ELM.json +1 -0
  17. data/raw/tb_params/Simserides2024_electron_FELM.json +1 -0
  18. data/raw/tb_params/Simserides2024_hole_ELM.json +1 -0
  19. data/raw/tb_params/Simserides2024_hole_FELM.json +1 -0
  20. data/raw/tb_params/__init__.py +0 -0
  21. gui/__init__.py +16 -0
  22. gui/config_frame.py +29 -0
  23. gui/custom_window.py +102 -0
  24. gui/diss_frame.py +134 -0
  25. gui/dynamics_frame.py +66 -0
  26. gui/ham_frame.py +79 -0
  27. gui/initial_frame.py +44 -0
  28. gui/options_frame.py +61 -0
  29. gui/plot_options_frame.py +202 -0
  30. gui/plotting_window.py +111 -0
  31. gui/qdna_app.py +160 -0
  32. gui/scrollable_console_frame.py +32 -0
  33. gui/user_interface_utils.py +8 -0
  34. qDNA/__init__.py +8 -0
  35. qDNA/dna_seq.py +208 -0
  36. qDNA/dynamics/__init__.py +2 -0
  37. qDNA/dynamics/reduced_dm.py +76 -0
  38. qDNA/dynamics/solver.py +387 -0
  39. qDNA/environment/__init__.py +3 -0
  40. qDNA/environment/lindblad.py +627 -0
  41. qDNA/environment/lindblad_rates.py +159 -0
  42. qDNA/environment/observables.py +189 -0
  43. qDNA/evaluation/__init__.py +3 -0
  44. qDNA/evaluation/dipole.py +121 -0
  45. qDNA/evaluation/eq_states.py +75 -0
  46. qDNA/evaluation/lifetime.py +92 -0
  47. qDNA/model/__init__.py +8 -0
  48. qDNA/model/tb_basis.py +339 -0
  49. qDNA/model/tb_config.py +269 -0
  50. qDNA/model/tb_ham.py +638 -0
  51. qDNA/model/tb_model.py +190 -0
  52. qDNA/model/tb_params.py +159 -0
  53. qDNA/plotting/__init__.py +24 -0
  54. qDNA/plotting/plot_dna_base_frequency.py +66 -0
  55. qDNA/plotting/plot_eigenspectrum.py +80 -0
  56. qDNA/plotting/plot_fourier.py +200 -0
  57. qDNA/plotting/plot_pop.py +171 -0
  58. qDNA/utils/__init__.py +3 -0
  59. qDNA/utils/dm_analysis.py +92 -0
  60. qDNA/utils/ham_analysis.py +149 -0
  61. qDNA/utils/unit_converter.py +94 -0
  62. qDNA-0.1.0.dist-info/LICENSE.txt +27 -0
  63. qDNA-0.1.0.dist-info/METADATA +235 -0
  64. qDNA-0.1.0.dist-info/RECORD +70 -0
  65. qDNA-0.1.0.dist-info/WHEEL +5 -0
  66. qDNA-0.1.0.dist-info/top_level.txt +5 -0
  67. tools/__init__.py +3 -0
  68. tools/check_input.py +71 -0
  69. tools/helpers.py +55 -0
  70. tools/save_load.py +126 -0
configs/__init__.py ADDED
File without changes
configs/config.yaml ADDED
@@ -0,0 +1,45 @@
1
+ # This file contains all the default values used for the simulations
2
+ project_name: "QuantumDNA"
3
+
4
+ verbose: False
5
+ DNA_BASES: ["A", "T", "G", "C", "c"]
6
+
7
+ SOURCES: ['Hawke2010', 'Simserides2014', 'Mantela2021', 'Simserides2024']
8
+ DESCRIPTIONS: ["1P", "2P"]
9
+ PARTICLES: ["electron", "hole", "exciton"]
10
+ UNITS: ['meV', 'eV', '100meV', 'rad/ps', 'rad/fs', '1/cm', 'K', 'J', '1/fs', '1/ps']
11
+ T_UNITS: ['fs', 'ps']
12
+ SPECTRAL_DENSITIES: ['debye', 'ohmic']
13
+ TB_MODELS: ['WM', 'LM', 'ELM', 'FWM', 'FLM', 'FELM', 'FC']
14
+
15
+ ham_kwargs_default:
16
+ source: 'Hawke2010'
17
+ description: '2P'
18
+ particles: ['electron','hole','exciton']
19
+ unit: 'rad/ps'
20
+ interaction_param: 0. # in rad/ps
21
+ relaxation: True
22
+ nn_cutoff: True
23
+
24
+ diss_kwargs_default:
25
+ loc_deph_rate: 0. # rad/fs
26
+ glob_deph_rate: 0. # rad/fs
27
+ uniform_relaxation: True
28
+ relax_rate: 0. # rad/fs
29
+ relax_rates: {'A': 0, 'T': 0, 'G': 0, 'C': 0, 'B': 0}
30
+ loc_therm: False
31
+ glob_therm: False
32
+ deph_rate: 7. # in rad/ps
33
+ cutoff_freq: 20. # in rad/ps
34
+ reorg_energy: 1. # in rad/ps
35
+ temperature: 300. # in K
36
+ spectral_density: 'debye'
37
+ exponent: 1.
38
+
39
+ me_kwargs_default:
40
+ t_steps: 500.
41
+ t_end: 3. # ps
42
+ t_unit: 'ps'
43
+ init_e_state: '(0, 0)'
44
+ init_h_state: '(0, 0)'
45
+ solver_method: 'adams'
data/__init__.py ADDED
File without changes
data/raw/__init__.py ADDED
File without changes
@@ -0,0 +1 @@
1
+ [{"E_A": -44, "E_T": -49, "E_G": -45, "E_C": -43, "t_AA": 0.16, "t_AT": 0.07, "t_AG": 0.01, "t_AC": -0.03, "t_TA": -0.07, "t_TT": -0.3, "t_TG": -0.17, "t_TC": 0.22, "t_GA": 0.3, "t_GT": -0.32, "t_GG": 0.2, "t_GC": 0.43, "t_CA": -0.12, "t_CT": 0.63, "t_CG": 0.15, "t_CC": -0.47, "h_AT": -0.09, "h_GC": 0.16, "h_TA": -0.09, "h_CG": 0.16, "r+_AA": 0.06, "r+_AT": 0.02, "r+_AG": 0.03, "r+_AC": -0.02, "r+_TA": 0.02, "r+_TT": 0.02, "r+_TG": 0.03, "r+_TC": -0.02, "r+_GA": 0.03, "r+_GT": 0.03, "r+_GG": -0.02, "r+_GC": -0.03, "r+_CA": -0.02, "r+_CT": -0.02, "r+_CG": -0.03, "r+_CC": 0.02, "r-_AA": 0.29, "r-_AT": 0.03, "r-_AG": -0.06, "r-_AC": -0.03, "r-_TA": 0.03, "r-_TT": 0.002, "r-_TG": 0.02, "r-_TC": -0.002, "r-_GA": -0.06, "r-_GT": 0.02, "r-_GG": -0.05, "r-_GC": -0.04, "r-_CA": -0.03, "r-_CT": -0.002, "r-_CG": -0.04, "r-_CC": 0.003}, {"source": "Hawke2010", "particle": "electron", "tb_model_name": "ELM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -44, "E_T": -49, "E_G": -45, "E_C": -43, "t_AA": 0.16, "t_AT": 0.07, "t_AG": 0.01, "t_AC": -0.03, "t_TA": -0.07, "t_TT": -0.3, "t_TG": -0.17, "t_TC": 0.22, "t_GA": 0.3, "t_GT": -0.32, "t_GG": 0.2, "t_GC": 0.43, "t_CA": -0.12, "t_CT": 0.63, "t_CG": 0.15, "t_CC": -0.47, "h_AT": -0.09, "h_GC": 0.16, "h_TA": -0.09, "h_CG": 0.16}, {"source": "Hawke2010", "particle": "electron", "tb_model_name": "LM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -49, "E_T": -49, "E_G": -45, "E_C": -45, "t_AA": -0.29, "t_AT": 0.005, "t_AG": 0.03, "t_AC": 0.32, "t_TA": 0.02, "t_TT": -0.29, "t_TG": 0.17, "t_TC": -0.01, "t_GA": -0.01, "t_GT": 0.32, "t_GG": 0.2, "t_GC": -0.1, "t_CA": 0.17, "t_CT": 0.03, "t_CG": -0.08, "t_CC": 0.2}, {"source": "Hawke2010", "particle": "electron", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -83, "E_T": -90, "E_G": -80, "E_C": -88, "t_AA": -0.08, "t_AT": 0.68, "t_AG": -0.05, "t_AC": 0.68, "t_TA": 0.26, "t_TT": -1.17, "t_TG": 0.28, "t_TC": -0.86, "t_GA": -0.79, "t_GT": 0.73, "t_GG": -0.62, "t_GC": 0.8, "t_CA": 0.05, "t_CT": -1.07, "t_CG": -0.01, "t_CC": -0.66, "h_AT": -0.12, "h_GC": -0.12, "h_TA": -0.12, "h_CG": -0.12, "r+_AA": 0.02, "r+_AT": 0.09, "r+_AG": 0.04, "r+_AC": 0.05, "r+_TA": 0.09, "r+_TT": 0.04, "r+_TG": 0.05, "r+_TC": 0.02, "r+_GA": 0.04, "r+_GT": 0.05, "r+_GG": 0.03, "r+_GC": 0.04, "r+_CA": 0.05, "r+_CT": 0.02, "r+_CG": 0.04, "r+_CC": 0.01, "r-_AA": 0.48, "r-_AT": -0.03, "r-_AG": -0.03, "r-_AC": -0.05, "r-_TA": -0.03, "r-_TT": 0.005, "r-_TG": 0.05, "r-_TC": 0.005, "r-_GA": -0.03, "r-_GT": 0.05, "r-_GG": -0.44, "r-_GC": 0.04, "r-_CA": 0.05, "r-_CT": 0.005, "r-_CG": 0.04, "r-_CC": 0.01}, {"source": "Hawke2010", "particle": "hole", "tb_model_name": "ELM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -83, "E_T": -83, "E_G": -80, "E_C": -80, "t_AA": -0.08, "t_AT": 0.2, "t_AG": -0.05, "t_AC": 0.02, "t_TA": 0.47, "t_TT": -0.08, "t_TG": -0.04, "t_TC": -0.79, "t_GA": -0.79, "t_GT": 0.02, "t_GG": -0.62, "t_GC": 0.01, "t_CA": -0.04, "t_CT": -0.05, "t_CG": -0.44, "t_CC": -0.62, "t_BB": 0.1, "h_AB": 0.1, "h_TB": 0.1, "h_GB": 0.1, "h_CB": 0.1, "h_BA": 0.1, "h_BT": 0.1, "h_BG": 0.1, "h_BC": 0.1}, {"source": "Hawke2010", "particle": "hole", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -83, "E_T": -90, "E_G": -80, "E_C": -88, "t_AA": -0.08, "t_AT": 0.68, "t_AG": -0.05, "t_AC": 0.68, "t_TA": 0.26, "t_TT": -1.17, "t_TG": 0.28, "t_TC": -0.86, "t_GA": -0.79, "t_GT": 0.73, "t_GG": -0.62, "t_GC": 0.8, "t_CA": 0.05, "t_CT": -1.07, "t_CG": -0.01, "t_CC": -0.66, "h_AT": -0.12, "h_GC": -0.12, "h_TA": -0.12, "h_CG": -0.12}, {"source": "Hawke2010", "particle": "hole", "tb_model_name": "LM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -83, "E_T": -83, "E_G": -80, "E_C": -80, "t_AA": -0.08, "t_AT": 0.2, "t_AG": -0.05, "t_AC": 0.02, "t_TA": 0.47, "t_TT": -0.08, "t_TG": -0.04, "t_TC": -0.79, "t_GA": -0.79, "t_GT": 0.02, "t_GG": -0.62, "t_GC": 0.01, "t_CA": -0.04, "t_CT": -0.05, "t_CG": -0.44, "t_CC": -0.62}, {"source": "Hawke2010", "particle": "hole", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -43.1, "E_T": -43.1, "E_G": -41.4, "E_C": -41.4, "t_AA": 0.22, "t_AT": 0.01, "t_AG": 0.11, "t_AC": 0.01, "t_TA": 0.02, "t_TT": 0.22, "t_TG": 0.09, "t_TC": 0.06, "t_GA": 0.06, "t_GT": 0.01, "t_GG": 0.02, "t_GC": 0.19, "t_CA": 0.09, "t_CT": 0.11, "t_CG": 0.09, "t_CC": 0.02}, {"source": "Mantela2021", "particle": "electron", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -84.9, "E_T": -84.9, "E_G": -83, "E_C": -83, "t_AA": 0.38, "t_AT": 0.5, "t_AG": 0.37, "t_AC": 0.16, "t_TA": 0.37, "t_TT": 0.38, "t_TG": 0.28, "t_TC": 1.42, "t_GA": 1.42, "t_GT": 0.16, "t_GG": 1.16, "t_GC": 0.1, "t_CA": 0.28, "t_CT": 0.37, "t_CG": 0.75, "t_CC": 116}, {"source": "Mantela2021", "particle": "hole", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -49, "E_T": -49, "E_G": -45, "E_C": -45, "t_AA": -0.29, "t_AT": 0.005, "t_AG": 0.03, "t_AC": 0.32, "t_TA": 0.02, "t_TT": -0.29, "t_TG": 0.17, "t_TC": -0.01, "t_GA": -0.01, "t_GT": 0.32, "t_GG": 0.2, "t_GC": -0.1, "t_CA": 0.17, "t_CT": 0.03, "t_CG": -0.08, "t_CC": 0.2}, {"source": "Simserides2014", "particle": "electron", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -83, "E_T": -83, "E_G": -80, "E_C": -80, "t_AA": -0.2, "t_AT": 0.35, "t_AG": -0.3, "t_AC": 0.1, "t_TA": 0.5, "t_TT": -0.2, "t_TG": -0.1, "t_TC": -1.1, "t_GA": -1.1, "t_GT": 0.1, "t_GG": -1.0, "t_GC": 0.1, "t_CA": -0.1, "t_CT": -0.3, "t_CG": -0.5, "t_CC": -1.0}, {"source": "Simserides2014", "particle": "hole", "tb_model_name": "WM", "unit": "100meV", "notes": "energy unit: 100 meV"}]
@@ -0,0 +1 @@
1
+ [{"E_A": -0.130, "E_T": -0.350, "E_G": -0.520, "E_C": -0.290, "E_c": -0.290, "t_GG": 0.206, "t_CC": 0.099, "t_AA": 0.074, "t_TT": 0.035, "t_GC": 0.007, "t_CG": 0.031, "t_AT": 0.071, "t_TA": 0.011, "t_CT": 0.071, "t_AG": 0.017, "t_TC": 0.077, "t_GA": 0.008, "t_CA": 0.020, "t_TG": 0.004, "t_AC": 0.021, "t_GT": 0.022, "t_cc": 0.056, "t_Cc": 0.067, "t_cC": 0.091, "t_cG": 0.031, "t_Gc": 0.002, "h_GC": 0.073, "h_Gc": 0.069, "h_AT": 0.002, "r-_GG": 0.021, "r-_CC": 0.090, "r-_AA": 0.081, "r-_TT": 0.009, "r-_GC": 0.097, "r-_CG": 0.097, "r-_AT": 0.005, "r-_TA": 0.005, "r-_CT": 0.010, "r-_AG": 0.051, "r-_TC": 0.010, "r-_GA": 0.051, "r-_CA": 0.023, "r-_TG": 0.017, "r-_AC": 0.023, "r-_GT": 0.017, "r-_cc": 0.097, "r-_Cc": 0.094, "r-_cC": 0.094, "r-_cG": 0.084, "r-_Gc": 0.084, "r+_GG": 0.212, "r+_CC": 0.181, "r+_AA": 0.037, "r+_TT": 0.009, "r+_GC": 0.019, "r+_CG": 0.019, "r+_AT": 0.008, "r+_TA": 0.008, "r+_CT": 0.023, "r+_AG": 0.043, "r+_TC": 0.023, "r+_GA": 0.043, "r+_CA": 0.041, "r+_TG": 0.031, "r+_AC": 0.041, "r+_GT": 0.031, "r+_cc": 0.192, "r+_Cc": 0.186, "r+_cC": 0.186, "r+_cG": 0.030, "r+_Gc": 0.030}, {"source": "Simserides2024", "particle": "electron", "tb_model_name": "ELM", "unit": "eV", "notes": "includes 5'-methylated cytosine denoted as 'c' "}]
@@ -0,0 +1 @@
1
+ [{"E_A": -0.130, "E_T": -0.350, "E_G": -0.520, "E_C": -0.290, "E_c": -0.290, "E_B": -5.000, "t_GG": 0.206, "t_CC": 0.099, "t_AA": 0.074, "t_TT": 0.035, "t_GC": 0.007, "t_CG": 0.031, "t_AT": 0.071, "t_TA": 0.011, "t_CT": 0.071, "t_AG": 0.017, "t_TC": 0.077, "t_GA": 0.008, "t_CA": 0.020, "t_TG": 0.004, "t_AC": 0.021, "t_GT": 0.022, "t_cc": 0.056, "t_Cc": 0.067, "t_cC": 0.091, "t_cG": 0.031, "t_Gc": 0.002, "t_BB": 0.700, "h_GC": 0.073, "h_Gc": 0.069, "h_AT": 0.002, "h_cB": 0.066, "h_GB": 0.092, "h_CB": 0.047, "h_AB": 0.260, "h_TB": 0.079, "r-_GG": 0.021, "r-_CC": 0.090, "r-_AA": 0.081, "r-_TT": 0.009, "r-_GC": 0.097, "r-_CG": 0.097, "r-_AT": 0.005, "r-_TA": 0.005, "r-_CT": 0.010, "r-_AG": 0.051, "r-_TC": 0.010, "r-_GA": 0.051, "r-_CA": 0.023, "r-_TG": 0.017, "r-_AC": 0.023, "r-_GT": 0.017, "r-_cc": 0.097, "r-_Cc": 0.094, "r-_cC": 0.094, "r-_cG": 0.084, "r-_Gc": 0.084, "r+_GG": 0.212, "r+_CC": 0.181, "r+_AA": 0.037, "r+_TT": 0.009, "r+_GC": 0.019, "r+_CG": 0.019, "r+_AT": 0.008, "r+_TA": 0.008, "r+_CT": 0.023, "r+_AG": 0.043, "r+_TC": 0.023, "r+_GA": 0.043, "r+_CA": 0.041, "r+_TG": 0.031, "r+_AC": 0.041, "r+_GT": 0.031, "r+_cc": 0.192, "r+_Cc": 0.186, "r+_cC": 0.186, "r+_cG": 0.030, "r+_Gc": 0.030}, {"source": "Simserides2024", "particle": "electron", "tb_model_name": "FELM", "unit": "eV", "notes": "includes 5'-methylated cytosine denoted as 'c' and sugar-phosphate backbone denoted as 'B' "}]
@@ -0,0 +1 @@
1
+ [{"E_A": -7.610, "E_T": -8.240, "E_G": -7.130, "E_C": -7.900, "E_c": -7.630, "t_GG": 0.126, "t_CC": 0.064, "t_AA": 0.028, "t_TT": 0.120, "t_GC": 0.151, "t_CG": 0.025, "t_AT": 0.073, "t_TA": 0.081, "t_CT": 0.048, "t_AG": 0.059, "t_TC": 0.092, "t_GA": 0.131, "t_CA": 0.030, "t_TG": 0.079, "t_AC": 0.074, "t_GT": 0.132, "t_cc": 0.105, "t_Cc": 0.098, "t_cC": 0.067, "t_cG": 0.029, "t_Gc": 0.208, "h_GC": 0.026, "h_Gc": 0.028, "h_AT": 0.034, "r-_GG": 0.030, "r-_CC": 0.004, "r-_AA": 0.082, "r-_TT": 0.002, "r-_GC": 0.027, "r-_CG": 0.027, "r-_AT": 0.008, "r-_TA": 0.008, "r-_CT": 0.002, "r-_AG": 0.014, "r-_TC": 0.002, "r-_GA": 0.014, "r-_CA": 0.018, "r-_TG": 0.018, "r-_AC": 0.018, "r-_GT": 0.018, "r-_cc": 0.004, "r-_Cc": 0.004, "r-_cC": 0.004, "r-_cG": 0.027, "r-_Gc": 0.027, "r+_GG": 0.028, "r+_CC": 0.000, "r+_AA": 0.043, "r+_TT": 0.002, "r+_GC": 0.001, "r+_CG": 0.001, "r+_AT": 0.013, "r+_TA": 0.013, "r+_CT": 0.000, "r+_AG": 0.018, "r+_TC": 0.000, "r+_GA": 0.018, "r+_CA": 0.000, "r+_TG": 0.007, "r+_AC": 0.000, "r+_GT": 0.007, "r+_cc": 0.000, "r+_Cc": 0.000, "r+_cC": 0.000, "r+_cG": 0.002, "r+_Gc": 0.002}, {"source": "Simserides2024", "particle": "hole", "tb_model_name": "ELM", "unit": "eV", "notes": "includes 5'-methylated cytosine denoted as 'c' "}]
@@ -0,0 +1 @@
1
+ [{"E_A": -7.610, "E_T": -8.240, "E_G": -7.130, "E_C": -7.900, "E_c": -7.630, "E_B": -9.400, "t_GG": 0.126, "t_CC": 0.064, "t_AA": 0.028, "t_TT": 0.120, "t_GC": 0.151, "t_CG": 0.025, "t_AT": 0.073, "t_TA": 0.081, "t_CT": 0.048, "t_AG": 0.059, "t_TC": 0.092, "t_GA": 0.131, "t_CA": 0.030, "t_TG": 0.079, "t_AC": 0.074, "t_GT": 0.132, "t_cc": 0.105, "t_Cc": 0.098, "t_cC": 0.067, "t_cG": 0.029, "t_Gc": 0.208, "t_BB": 0.026, "h_GC": 0.026, "h_Gc": 0.028, "h_AT": 0.034, "h_cB": 0.178, "h_GB": 0.016, "h_CB": 0.173, "h_AB": 0.024, "h_TB": 0.179, "r-_GG": 0.030, "r-_CC": 0.004, "r-_AA": 0.082, "r-_TT": 0.002, "r-_GC": 0.027, "r-_CG": 0.027, "r-_AT": 0.008, "r-_TA": 0.008, "r-_CT": 0.002, "r-_AG": 0.014, "r-_TC": 0.002, "r-_GA": 0.014, "r-_CA": 0.018, "r-_TG": 0.018, "r-_AC": 0.018, "r-_GT": 0.018, "r-_cc": 0.004, "r-_Cc": 0.004, "r-_cC": 0.004, "r-_cG": 0.027, "r-_Gc": 0.027, "r+_GG": 0.028, "r+_CC": 0.000, "r+_AA": 0.043, "r+_TT": 0.002, "r+_GC": 0.001, "r+_CG": 0.001, "r+_AT": 0.013, "r+_TA": 0.013, "r+_CT": 0.000, "r+_AG": 0.018, "r+_TC": 0.000, "r+_GA": 0.018, "r+_CA": 0.000, "r+_TG": 0.007, "r+_AC": 0.000, "r+_GT": 0.007, "r+_cc": 0.000, "r+_Cc": 0.000, "r+_cC": 0.000, "r+_cG": 0.002, "r+_Gc": 0.002}, {"source": "Simserides2024", "particle": "hole", "tb_model_name": "ELM", "unit": "eV", "notes": "includes 5'-methylated cytosine denoted as 'c' and the sugar-phosphate backbone denoted as 'B' "}]
File without changes
gui/__init__.py ADDED
@@ -0,0 +1,16 @@
1
+ from .user_interface_utils import *
2
+
3
+ from .initial_frame import InitialFrame
4
+ from .config_frame import ConfigFrame
5
+ from .custom_window import CustomWindow
6
+
7
+ from .ham_frame import HamFrame
8
+ from .diss_frame import DissFrame
9
+ from .dynamics_frame import DynamicsFrame
10
+ from .options_frame import OptionsFrame
11
+
12
+ from .plot_options_frame import PlotOptionsFrame
13
+ from .plotting_window import *
14
+ from .scrollable_console_frame import ScrollableConsoleFrame
15
+
16
+ from .qdna_app import *
gui/config_frame.py ADDED
@@ -0,0 +1,29 @@
1
+ import customtkinter as ctk
2
+
3
+ class ConfigFrame(ctk.CTkFrame):
4
+ def __init__(self, master, **kwargs):
5
+ """
6
+ Notes:
7
+ This frame is located in the main/ menu window. This means that the main window is its master.
8
+ The frame uses the commands open_custom_window() and open_github() from the master
9
+
10
+ Widgets with get() method:
11
+ appearance_mode_combo
12
+ """
13
+
14
+ # initialization of the ctk.CTkFrame class
15
+ super().__init__(master)
16
+
17
+ # widgets
18
+ self.open_github_button = ctk.CTkButton(self, text="GitHub", command=master.open_github)
19
+ self.open_github_button.grid(row=8, column=0, pady=10, padx=10)
20
+
21
+ self.open_custom_window_button = ctk.CTkButton(self, text="Customize", command=master.open_custom_window)
22
+ self.open_custom_window_button.grid(row=9, column=0, pady=10, padx=10)
23
+
24
+ self.appearance_mode_label = ctk.CTkLabel(self, text="Appearance Mode:", anchor="w")
25
+ self.appearance_mode_label.grid(row=10, column=0, pady=10, padx=10)
26
+
27
+ self.appearance_mode_combo = ctk.CTkComboBox(self, values=["Light", "Dark", "System"], command=ctk.set_appearance_mode)
28
+ self.appearance_mode_combo.grid(row=11, column=0, pady=10, padx=10)
29
+ self.appearance_mode_combo.set('System')
gui/custom_window.py ADDED
@@ -0,0 +1,102 @@
1
+ import customtkinter as ctk
2
+ import webbrowser
3
+
4
+ from qDNA import wrap_save_tb_params
5
+
6
+ class CustomFrame(ctk.CTkFrame):
7
+ def __init__(self, master, configs):
8
+ """
9
+ Notes:
10
+ This frame is located in the custom window. This means that the custom window is its master.
11
+ The frame uses the commands save() and cancel() from the master
12
+
13
+ Widgets with get() method:
14
+ tb_params_entry, source_entry, particle_combobox, tb_model_combobox, unit_combobox, methylation_checkbox
15
+ """
16
+
17
+ # initialization of the ctk.CTkFrame class
18
+ super().__init__(master)
19
+ self.configs = configs
20
+
21
+ # widgets
22
+ self.tb_params_label = ctk.CTkLabel(self, text="TB parameters:")
23
+ self.tb_params_label.grid(row=0, column=0, columnspan=2, pady=10, padx=10)
24
+
25
+ self.tb_params_entry = ctk.CTkEntry(self)
26
+ self.tb_params_entry.grid(row=1, column=0, columnspan=2, padx=10, pady=10)
27
+
28
+ self.source_label = ctk.CTkLabel(self, text="Source:")
29
+ self.source_label.grid(row=2, column=0, columnspan=2, padx=10, pady=10)
30
+
31
+ self.source_entry = ctk.CTkEntry(self)
32
+ self.source_entry.grid(row=3, column=0, columnspan=2, padx=10, pady=10)
33
+
34
+ self.particle_label = ctk.CTkLabel(self, text="Particle:")
35
+ self.particle_label.grid(row=4, column=0, columnspan=2, padx=10, pady=10)
36
+
37
+ self.particle_combobox = ctk.CTkComboBox(self, values=self.configs['PARTICLES'] )
38
+ self.particle_combobox.grid(row=5, column=0, columnspan=2, padx=10, pady=10)
39
+
40
+ self.tb_model_label = ctk.CTkLabel(self, text="TB Model:")
41
+ self.tb_model_label.grid(row=6, column=0, columnspan=2, padx=10, pady=10)
42
+
43
+ self.tb_model_combobox = ctk.CTkComboBox(self, values=self.configs['TB_MODELS'] )
44
+ self.tb_model_combobox.grid(row=7, column=0, columnspan=2, padx=10, pady=10)
45
+
46
+ self.unit_label = ctk.CTkLabel(self, text="Unit:")
47
+ self.unit_label.grid(row=8, column=0, columnspan=2, padx=10, pady=10)
48
+
49
+ self.unit_combobox = ctk.CTkComboBox(self, values=self.configs['UNITS'] )
50
+ self.unit_combobox.grid(row=9, column=0, columnspan=2, padx=10, pady=10)
51
+
52
+ check_var = ctk.BooleanVar(value=True)
53
+ self.methylation_checkbox = ctk.CTkCheckBox(self, text="Methylation", variable=check_var, onvalue=True, offvalue=False)
54
+ self.methylation_checkbox.grid(row=10, column=0, columnspan=2, padx=10, pady=10)
55
+
56
+ self.save_button = ctk.CTkButton(self, text="Save", command=master.save)
57
+ self.save_button.grid(row=11, column=0, padx=10, pady=10)
58
+
59
+ self.cancel_button = ctk.CTkButton(self, text="Cancel", command=master.cancel)
60
+ self.cancel_button.grid(row=11, column=1, padx=10, pady=10)
61
+
62
+ class CustomWindow(ctk.CTkToplevel):
63
+ def __init__(self, master, configs):
64
+ """
65
+ Notes:
66
+ This window is a toplevel window of the main window. This means that the main window is its master.
67
+ The frame uses the commands save() and cancel() from the master
68
+ """
69
+
70
+ # initialization of the ctk.CTkToplevel class
71
+ super().__init__(master)
72
+ self.title("Customize")
73
+
74
+ # add a instance of CustomFrame to the window
75
+ self.custom_frame = CustomFrame(self, configs)
76
+ self.custom_frame.grid(row=0, column=0, columnspan=2, padx=10, pady=10, sticky="nsew")
77
+
78
+ def get_custom_frame_params(self):
79
+ """
80
+ Makes all parameters of custom_frame available in this window.
81
+ """
82
+ self.tb_param_dict = self.custom_frame.tb_params_entry.get()
83
+ self.source = self.custom_frame.source_entry.get()
84
+ self.particle = self.custom_frame.particle_combobox.get()
85
+ self.tb_model_name = self.custom_frame.tb_model_combobox.get()
86
+ self.unit = self.custom_frame.unit_combobox.get()
87
+ self.methylated = self.custom_frame.methylation_checkbox.get()
88
+
89
+ def save(self):
90
+ """
91
+ Saves the tight-binding parameters and closes the window.
92
+ """
93
+ self.get_custom_frame_params()
94
+ notes = f"methlation {self.methylated}"
95
+ wrap_save_tb_params(self.tb_param_dict, self.source, self.particle, self.tb_model_name, self.unit, notes=notes)
96
+ self.destroy()
97
+
98
+ def cancel(self):
99
+ """
100
+ Closes the window.
101
+ """
102
+ self.destroy()
gui/diss_frame.py ADDED
@@ -0,0 +1,134 @@
1
+ import customtkinter as ctk
2
+
3
+ from tools import get_config
4
+
5
+ class DissFrame(ctk.CTkFrame):
6
+ def __init__(self, master, configs, **kwargs):
7
+ """
8
+ Notes:
9
+ This frame is located in the options tab. This means that the options tab is its master.
10
+ """
11
+
12
+ # initialization of the ctk.CTkFrame class
13
+ super().__init__(master)
14
+ self.pack(fill="both", expand=True)
15
+ self.configs = configs
16
+ self.diss_kwargs_default = self.configs['diss_kwargs_default']
17
+
18
+ # widgets
19
+ self.diss_loc_deph_rate_label = ctk.CTkLabel(self, text="Local Dephasing Rate:")
20
+ self.diss_loc_deph_rate_label.grid(row=0, column=0, padx=10, pady=10)
21
+
22
+ self.diss_loc_deph_rate_entry = ctk.CTkEntry(self)
23
+ self.diss_loc_deph_rate_entry.insert(0, str(self.diss_kwargs_default['loc_deph_rate']))
24
+ self.diss_loc_deph_rate_entry.grid(row=0, column=1, padx=10, pady=10)
25
+
26
+ self.diss_glob_deph_rate_label = ctk.CTkLabel(self, text="Global Dephasing Rate:")
27
+ self.diss_glob_deph_rate_label.grid(row=1, column=0, padx=10, pady=10)
28
+
29
+ self.diss_glob_deph_rate_entry = ctk.CTkEntry(self)
30
+ self.diss_glob_deph_rate_entry.insert(0, str(self.diss_kwargs_default['glob_deph_rate']))
31
+ self.diss_glob_deph_rate_entry.grid(row=1, column=1, padx=10, pady=10)
32
+
33
+ # -------------------------------
34
+
35
+ self.diss_uniform_relaxation_var = ctk.BooleanVar(value=self.diss_kwargs_default['uniform_relaxation'])
36
+ self.diss_uniform_relaxation_check = ctk.CTkCheckBox(self, text="Uniform Relaxation", variable=self.diss_uniform_relaxation_var,
37
+ command=self.set_uniform_relax)
38
+ self.diss_uniform_relaxation_check.grid(row=2, column=0, columnspan=2, padx=10, pady=10)
39
+
40
+ self.diss_relax_rate_label = ctk.CTkLabel(self, text="Relaxation Rate \n (uniform):")
41
+ self.diss_relax_rate_label.grid(row=3, column=0, padx=10, pady=10)
42
+
43
+ self.diss_relax_rate_entry = ctk.CTkEntry(self)
44
+ self.diss_relax_rate_entry.insert(0, str(self.diss_kwargs_default['relax_rate']))
45
+ self.diss_relax_rate_entry.grid(row=3, column=1, padx=10, pady=10)
46
+
47
+ self.diss_relax_rates_label = ctk.CTkLabel(self, text="Relaxation Rates \n (non-uniform):")
48
+ self.diss_relax_rates_label.grid(row=4, column=0, padx=10, pady=10)
49
+
50
+ self.diss_relax_rates_entry = ctk.CTkEntry(self, state='disabled')
51
+ self.diss_relax_rates_entry.insert(0, str(self.diss_kwargs_default['relax_rates']) )
52
+ self.diss_relax_rates_entry.grid(row=4, column=1, padx=10, pady=10)
53
+
54
+ # -----------------------------------
55
+
56
+ self.diss_loc_therm_var = ctk.BooleanVar(value=self.diss_kwargs_default['loc_therm'])
57
+ self.diss_loc_therm_check = ctk.CTkCheckBox(self, text="Local Thermalization", variable=self.diss_loc_therm_var)
58
+ self.diss_loc_therm_check.grid(row=5, column=0, padx=10, pady=10)
59
+
60
+ self.diss_glob_therm_var = ctk.BooleanVar(value=self.diss_kwargs_default['glob_therm'])
61
+ self.diss_glob_therm_check = ctk.CTkCheckBox(self, text="Global Thermalization", variable=self.diss_glob_therm_var)
62
+ self.diss_glob_therm_check.grid(row=6, column=0, padx=10, pady=10)
63
+
64
+ self.diss_deph_rate_label = ctk.CTkLabel(self, text="Dephasing Rate:")
65
+ self.diss_deph_rate_label.grid(row=7, column=0, padx=10, pady=10)
66
+
67
+ self.diss_deph_rate_entry = ctk.CTkEntry(self)
68
+ self.diss_deph_rate_entry.insert(0, str(self.diss_kwargs_default['deph_rate']))
69
+ self.diss_deph_rate_entry.grid(row=7, column=1, padx=10, pady=10)
70
+
71
+ self.diss_cutoff_freq_label = ctk.CTkLabel(self, text="Cutoff Frequency:")
72
+ self.diss_cutoff_freq_label.grid(row=8, column=0, padx=10, pady=10)
73
+
74
+ self.diss_cutoff_freq_entry = ctk.CTkEntry(self)
75
+ self.diss_cutoff_freq_entry.insert(0, str(self.diss_kwargs_default['cutoff_freq']))
76
+ self.diss_cutoff_freq_entry.grid(row=8, column=1, padx=10, pady=10)
77
+
78
+ self.diss_reorg_energy_label = ctk.CTkLabel(self, text="Reorganization Energy:")
79
+ self.diss_reorg_energy_label.grid(row=9, column=0, padx=10, pady=10)
80
+
81
+ self.diss_reorg_energy_entry = ctk.CTkEntry(self)
82
+ self.diss_reorg_energy_entry.insert(0, str(self.diss_kwargs_default['reorg_energy']))
83
+ self.diss_reorg_energy_entry.grid(row=9, column=1, padx=10, pady=10)
84
+
85
+ self.diss_temperature_label = ctk.CTkLabel(self, text="Temperature (K):")
86
+ self.diss_temperature_label.grid(row=10, column=0, padx=10, pady=10)
87
+
88
+ self.diss_temperature_entry = ctk.CTkEntry(self)
89
+ self.diss_temperature_entry.insert(0, str(self.diss_kwargs_default['temperature']))
90
+ self.diss_temperature_entry.grid(row=10, column=1, padx=10, pady=10)
91
+
92
+ self.diss_spectral_density_label = ctk.CTkLabel(self, text="Spectral Density:")
93
+ self.diss_spectral_density_label.grid(row=11, column=0, padx=10, pady=10)
94
+
95
+ self.diss_spectral_density_combo = ctk.CTkComboBox(self, values=self.configs['SPECTRAL_DENSITIES'] )
96
+ self.diss_spectral_density_combo.set(self.diss_kwargs_default['spectral_density'])
97
+ self.diss_spectral_density_combo.grid(row=11, column=1, padx=10, pady=10)
98
+
99
+ self.diss_exponent_label = ctk.CTkLabel(self, text="Exponent:")
100
+ self.diss_exponent_label.grid(row=12, column=0, padx=10, pady=10)
101
+
102
+ self.diss_exponent_entry = ctk.CTkEntry(self)
103
+ self.diss_exponent_entry.insert(0, str(self.diss_kwargs_default['exponent']))
104
+ self.diss_exponent_entry.grid(row=12, column=1, padx=10, pady=10)
105
+
106
+ def set_uniform_relax(self):
107
+ if self.diss_uniform_relaxation_var.get():
108
+ self.diss_relax_rate_entry.configure(state='normal')
109
+ self.diss_relax_rates_entry.configure(state='disabled')
110
+ else:
111
+ self.diss_relax_rate_entry.configure(state='disabled')
112
+ self.diss_relax_rates_entry.configure(state='normal')
113
+
114
+ def get_diss_kwargs(self):
115
+ """
116
+ Returns the values of widgets with get() method in dictionary format.
117
+ """
118
+
119
+ diss_kwargs = {
120
+ "loc_deph_rate": float(self.diss_loc_deph_rate_entry.get()),
121
+ "glob_deph_rate": float(self.diss_glob_deph_rate_entry.get()),
122
+ "uniform_relaxation": self.diss_uniform_relaxation_var.get(),
123
+ "relax_rate": float(self.diss_relax_rate_entry.get()),
124
+ "relax_rates": dict(self.diss_relax_rates_entry.get()),
125
+ "loc_therm": self.diss_loc_therm_var.get(),
126
+ "glob_therm": self.diss_glob_therm_var.get(),
127
+ "deph_rate": float(self.diss_deph_rate_entry.get()),
128
+ "cutoff_freq": float(self.diss_cutoff_freq_entry.get()),
129
+ "reorg_energy": float(self.diss_reorg_energy_entry.get()),
130
+ "temperature": float(self.diss_temperature_entry.get()),
131
+ "spectral_density": self.diss_spectral_density_combo.get(),
132
+ "exponent": float(self.diss_exponent_entry.get()),
133
+ }
134
+ return diss_kwargs
gui/dynamics_frame.py ADDED
@@ -0,0 +1,66 @@
1
+ import customtkinter as ctk
2
+
3
+ from tools import get_config
4
+
5
+ class DynamicsFrame(ctk.CTkFrame):
6
+ def __init__(self, master, configs, **kwargs):
7
+ """
8
+ Notes:
9
+ This frame is located in the options tab. This means that the options tab is its master.
10
+ """
11
+
12
+ # initialization of the ctk.CTkFrame class
13
+ super().__init__(master)
14
+ self.pack(fill="both", expand=True)
15
+ self.configs = configs
16
+ self.me_kwargs_default = self.configs['me_kwargs_default']
17
+
18
+ # widgets
19
+ self.me_t_steps_label = ctk.CTkLabel(self, text="Time Steps:")
20
+ self.me_t_steps_label.grid(row=0, column=0, padx=10, pady=10)
21
+
22
+ self.me_t_steps_entry = ctk.CTkEntry(self)
23
+ self.me_t_steps_entry.insert(0, str(self.me_kwargs_default['t_steps']))
24
+ self.me_t_steps_entry.grid(row=0, column=1, padx=10, pady=10)
25
+
26
+ self.me_t_end_label = ctk.CTkLabel(self, text="Time End:")
27
+ self.me_t_end_label.grid(row=1, column=0, padx=10, pady=10)
28
+
29
+ self.me_t_end_entry = ctk.CTkEntry(self)
30
+ self.me_t_end_entry.insert(0, str(self.me_kwargs_default['t_end']))
31
+ self.me_t_end_entry.grid(row=1, column=1, padx=10, pady=10)
32
+
33
+ self.me_t_unit_label = ctk.CTkLabel(self, text="Time Unit:")
34
+ self.me_t_unit_label.grid(row=2, column=0, padx=10, pady=10)
35
+
36
+ self.me_t_unit_combo = ctk.CTkComboBox(self, values=self.configs['T_UNITS'] )
37
+ self.me_t_unit_combo.set(self.me_kwargs_default['t_unit'])
38
+ self.me_t_unit_combo.grid(row=2, column=1, padx=10, pady=10)
39
+
40
+ self.me_init_e_state_label = ctk.CTkLabel(self, text="Initial Electron State:")
41
+ self.me_init_e_state_label.grid(row=3, column=0, padx=10, pady=10)
42
+
43
+ self.me_init_e_state_combo = ctk.CTkComboBox(self, values=self.me_kwargs_default['init_e_state'])
44
+ self.me_init_e_state_combo.grid(row=3, column=1, padx=10, pady=10)
45
+ self.me_init_e_state_combo.set(self.me_kwargs_default['init_e_state'])
46
+
47
+ self.me_init_h_state_label = ctk.CTkLabel(self, text="Initial Hole State:")
48
+ self.me_init_h_state_label.grid(row=4, column=0, padx=10, pady=10)
49
+
50
+ self.me_init_h_state_combo = ctk.CTkComboBox(self, values=self.me_kwargs_default['init_h_state'])
51
+ self.me_init_h_state_combo.grid(row=4, column=1, padx=10, pady=10)
52
+ self.me_init_h_state_combo.set(self.me_kwargs_default['init_h_state'])
53
+
54
+ def get_me_kwargs(self):
55
+ """
56
+ Returns the values of widgets with get() method in dictionary format.
57
+ """
58
+
59
+ me_kwargs = {
60
+ "t_steps": float(self.me_t_steps_entry.get()),
61
+ "t_end": float(self.me_t_end_entry.get()),
62
+ "t_unit": self.me_t_unit_combo.get(),
63
+ "init_e_state": self.me_init_e_state_combo.get(),
64
+ "init_h_state": self.me_init_h_state_combo.get(),
65
+ }
66
+ return me_kwargs
gui/ham_frame.py ADDED
@@ -0,0 +1,79 @@
1
+ import customtkinter as ctk
2
+
3
+ from qDNA import wrap_save_tb_params
4
+ from tools import get_config
5
+
6
+ class HamFrame(ctk.CTkFrame):
7
+ def __init__(self, master, configs, **kwargs):
8
+ """
9
+ Notes:
10
+ This frame is located in the options tab. This means that the options tab is its master.
11
+ """
12
+
13
+ # initialization of the ctk.CTkFrame class
14
+ super().__init__(master)
15
+ self.pack(fill="both", expand=True)
16
+ self.configs = configs
17
+ self.ham_kwargs_default = self.configs['ham_kwargs_default']
18
+
19
+ # widgets
20
+ self.ham_source_label = ctk.CTkLabel(self, text="Source:")
21
+ self.ham_source_label.grid(row=0, column=0, padx=10, pady=10)
22
+
23
+ self.ham_source_combo = ctk.CTkComboBox(self, values=self.configs['SOURCES'] )
24
+ self.ham_source_combo.set(self.ham_kwargs_default['source'])
25
+ self.ham_source_combo.grid(row=0, column=1, padx=10, pady=10)
26
+
27
+ self.ham_description_label = ctk.CTkLabel(self, text="Description:")
28
+ self.ham_description_label.grid(row=1, column=0, padx=10, pady=10)
29
+
30
+ self.ham_description_combo = ctk.CTkComboBox(self, values=self.configs['DESCRIPTIONS'] )
31
+ self.ham_description_combo.set(self.ham_kwargs_default['description'])
32
+ self.ham_description_combo.grid(row=1, column=1, padx=10, pady=10)
33
+
34
+ self.ham_particles_label = ctk.CTkLabel(self, text="Particles:")
35
+ self.ham_particles_label.grid(row=2, column=0, padx=10, pady=10)
36
+
37
+ self.particles = self.configs['PARTICLES']
38
+ self.selected_particles = {particle: ctk.BooleanVar(value=True) for particle in self.particles}
39
+ for idx, particle in enumerate(self.particles):
40
+ checkbox = ctk.CTkCheckBox(self, text=particle, variable=self.selected_particles[particle])
41
+ checkbox.grid(row=3+idx, column=0, padx=20, pady=5, columnspan=2)
42
+
43
+ self.ham_unit_label = ctk.CTkLabel(self, text="Unit:")
44
+ self.ham_unit_label.grid(row=6, column=0, padx=10, pady=10)
45
+
46
+ self.ham_unit_combo = ctk.CTkComboBox(self, values=self.configs['UNITS'] )
47
+ self.ham_unit_combo.set(self.ham_kwargs_default['unit'])
48
+ self.ham_unit_combo.grid(row=6, column=1, padx=10, pady=10)
49
+
50
+ self.ham_interaction_param_label = ctk.CTkLabel(self, text="Interaction Param:")
51
+ self.ham_interaction_param_label.grid(row=7, column=0, padx=10, pady=10)
52
+
53
+ self.ham_interaction_param_entry = ctk.CTkEntry(self)
54
+ self.ham_interaction_param_entry.insert(0, str(self.ham_kwargs_default['interaction_param']))
55
+ self.ham_interaction_param_entry.grid(row=7, column=1, padx=10, pady=10)
56
+
57
+ self.ham_relaxation_var = ctk.BooleanVar(value=self.ham_kwargs_default['relaxation'])
58
+ self.ham_relaxation_check = ctk.CTkCheckBox(self, text="Relaxation", variable=self.ham_relaxation_var)
59
+ self.ham_relaxation_check.grid(row=12, column=0, padx=10, pady=10, columnspan=2)
60
+
61
+ self.ham_nn_cutoff_var = ctk.BooleanVar(value=self.ham_kwargs_default['nn_cutoff'])
62
+ self.ham_nn_cutoff_check = ctk.CTkCheckBox(self, text="NN Cutoff", variable=self.ham_nn_cutoff_var)
63
+ self.ham_nn_cutoff_check.grid(row=13, column=0, padx=10, pady=10, columnspan=2)
64
+
65
+ def get_ham_kwargs(self):
66
+ """
67
+ Returns the values of widgets with get() method in dictionary format.
68
+ """
69
+
70
+ ham_kwargs = {
71
+ "source": self.ham_source_combo.get(),
72
+ "description": self.ham_description_combo.get(),
73
+ "particles": [particle for particle, var in self.selected_particles.items() if var.get()],
74
+ "unit": self.ham_unit_combo.get(),
75
+ "interaction_param": float(self.ham_interaction_param_entry.get()),
76
+ "relaxation": self.ham_relaxation_var.get(),
77
+ "nn_cutoff": self.ham_nn_cutoff_var.get(),
78
+ }
79
+ return ham_kwargs
gui/initial_frame.py ADDED
@@ -0,0 +1,44 @@
1
+ import customtkinter as ctk
2
+
3
+ class InitialFrame(ctk.CTkFrame):
4
+ def __init__(self, master, **kwargs):
5
+ """
6
+ Notes:
7
+ This frame is located in the main/ menu window. This means that the main window is its master.
8
+ The frame uses the commands press_first_confirm() from the master.
9
+
10
+ Widgets with get() method:
11
+ upper_strand_entry, tb_model_combo
12
+ """
13
+
14
+ # initialization of the ctk.CTkFrame class
15
+ super().__init__(master)
16
+
17
+ # widgets
18
+ self.logo_label = ctk.CTkLabel(self, text="QuantumDNA", font=ctk.CTkFont(size=20, weight="bold"))
19
+ self.logo_label.grid(row=0, column=0, pady=10, padx=10)
20
+
21
+ self.upper_strand_label = ctk.CTkLabel(self, text="DNA Sequence \n (upper strand):")
22
+ self.upper_strand_label.grid(row=1, column=0, pady=10, padx=10)
23
+
24
+ self.upper_strand_entry = ctk.CTkEntry(self)
25
+ self.upper_strand_entry.grid(row=2, column=0, pady=10, padx=10)
26
+ self.upper_strand_entry.insert(0, 'GCG')
27
+
28
+ self.tb_model_label = ctk.CTkLabel(self, text="TB Model:")
29
+ self.tb_model_label.grid(row=3, column=0, pady=10, padx=10)
30
+
31
+ self.tb_model_combo = ctk.CTkComboBox(self, values=master.configs['TB_MODELS'])
32
+ self.tb_model_combo.grid(row=4, column=0, pady=10, padx=10)
33
+ self.tb_model_combo.set('WM')
34
+
35
+ self.first_confirm_button = ctk.CTkButton(self, text="Confirm", command=master.press_first_confirm)
36
+ self.first_confirm_button.grid(row=5, column=0, pady=10, padx=10)
37
+
38
+ def change_state(self, state):
39
+ """
40
+ Changes the state of certain widgets (between 'normal' and 'disabled').
41
+ """
42
+ self.upper_strand_entry.configure(state=state)
43
+ self.tb_model_combo.configure(state=state)
44
+ self.first_confirm_button.configure(state=state)