Skip to content

Commit

Permalink
Switch Matsubara grid scalar to discrete grid size
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Feb 19, 2024
1 parent 7d584ee commit 14dcca8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
7 changes: 4 additions & 3 deletions examples/coulomb_blockade/pentacene/hybr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def hybridize_orbitals(
E_min=-3.0,
E_max=3.0,
E_step=1e-2,
matsubara_grid_scalar=1.0,
matsubara_grid_size=3000,
) -> None:
"""docstring"""

Expand Down Expand Up @@ -72,8 +72,9 @@ def hybridize_orbitals(
# Matsubara
gf.eta = 0.0
beta = 1 / (kB * temperature)
E_grid_size = len(energies) * matsubara_grid_scalar
matsubara_energies = 1.0j * (2 * np.arange(E_grid_size) + 1) * np.pi / beta
matsubara_energies = (
1.0j * (2 * np.arange(matsubara_grid_size) + 1) * np.pi / beta
)
gd = GridDesc(matsubara_energies, no, complex)
HB = gd.empty_aligned_orbs()

Expand Down
2 changes: 1 addition & 1 deletion examples/coulomb_blockade/tester.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
" \"hybridization\": {\n",
" \"code\": orm.load_code(\"hybr-script\"),\n",
" \"temperature\": orm.Float(300.0),\n",
" \"matsubara_grid_scalar\": orm.Float(1.0),\n",
" \"matsubara_grid_size\": orm.Int(3000),\n",
" \"metadata\": metadata,\n",
" },\n",
" \"dmft\": {\n",
Expand Down
10 changes: 5 additions & 5 deletions src/aiida_quantum_transport/calculations/hybridize.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def define(cls, spec: CalcJobProcessSpec) -> None:
)

spec.input(
"matsubara_grid_scalar",
valid_type=orm.Float,
default=lambda: orm.Float(1.0),
help="The scalar used to modify the matsubara energy grid",
"matsubara_grid_size",
valid_type=orm.Int,
default=lambda: orm.Int(3000),
help="The size of the Matsubara energy grid",
)

spec.input(
Expand Down Expand Up @@ -146,7 +146,7 @@ def prepare_for_submission(self, folder: Folder) -> CalcInfo:
**self.inputs.energy_grid_parameters,
**self.inputs.parameters,
"temperature": self.inputs.temperature.value,
"matsubara_grid_scalar": self.inputs.matsubara_grid_scalar.value,
"matsubara_grid_size": self.inputs.matsubara_grid_size.value,
}
pickle.dump(parameters, file)

Expand Down
7 changes: 1 addition & 6 deletions src/aiida_quantum_transport/workchains/coulomb_diamonds.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ def define(cls, spec: WorkChainSpec) -> None:
spec.expose_inputs(
HybridizationCalculation,
namespace="hybridization",
include=[
"code",
"temperature",
"matsubara_grid_scalar",
"metadata",
],
include=["code", "temperature", "matsubara_grid_size", "metadata"],
)

spec.expose_inputs(
Expand Down

0 comments on commit 14dcca8

Please sign in to comment.