-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tetku.py] Add square d-wave and s-wave BCS model.
- Loading branch information
Showing
4 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2022-2023 Hao Zhang<[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2022-2023 Hao Zhang<[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2021-2023 Hao Zhang<[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
import TAT | ||
import tetragono as tet | ||
|
||
|
||
def abstract_state(L1, L2, t, Delta, mu): | ||
""" | ||
Create BCS d-wave model state. | ||
Parameters | ||
---------- | ||
L1, L2 : int | ||
The lattice size. | ||
t, Delta : float | ||
BCS model parameters. | ||
mu : float | ||
chemical potential. | ||
""" | ||
state = tet.AbstractState(TAT.Parity.D.Tensor, L1, L2) | ||
state.physics_edges[...] = [(False, 2), (True, 2)] | ||
|
||
CSCS = tet.common_tensor.Parity_Hubbard.CSCS.to(float) | ||
|
||
N0 = tet.common_tensor.Parity_Hubbard.N0.to(float) | ||
N1 = tet.common_tensor.Parity_Hubbard.N1.to(float) | ||
N = N0 + N1 | ||
|
||
state.hamiltonians["vertical_bond"] = -t * CSCS + Delta * tet.common_tensor.Parity_Hubbard.singlet.to(float) | ||
state.hamiltonians["horizontal_bond"] = -t * CSCS - Delta * tet.common_tensor.Parity_Hubbard.singlet.to(float) | ||
state.hamiltonians["single_site"] = -mu * N | ||
return state | ||
|
||
|
||
def abstract_lattice(L1, L2, D, t, Delta, mu): | ||
""" | ||
Create BCS model lattice. | ||
Parameters | ||
---------- | ||
L1, L2 : int | ||
The lattice size. | ||
D : int | ||
The cut dimension. | ||
t, Delta : float | ||
BCS model parameters. | ||
mu : float | ||
chemical potential. | ||
""" | ||
state = tet.AbstractLattice(abstract_state(L1, L2, t, Delta, mu)) | ||
D0 = D // 2 | ||
D1 = D - D0 | ||
state.virtual_bond["R"] = state.virtual_bond["D"] = [(False, D0), (True, D1)] | ||
|
||
return state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2021-2023 Hao Zhang<[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
import TAT | ||
import tetragono as tet | ||
|
||
|
||
def abstract_state(L1, L2, t, Delta, mu): | ||
""" | ||
Create BCS d-wave model state. | ||
Parameters | ||
---------- | ||
L1, L2 : int | ||
The lattice size. | ||
t, Delta : float | ||
BCS model parameters. | ||
mu : float | ||
chemical potential. | ||
""" | ||
state = tet.AbstractState(TAT.Parity.D.Tensor, L1, L2) | ||
state.physics_edges[...] = [(False, 2), (True, 2)] | ||
|
||
CSCS = tet.common_tensor.Parity_Hubbard.CSCS.to(float) | ||
|
||
N0 = tet.common_tensor.Parity_Hubbard.N0.to(float) | ||
N1 = tet.common_tensor.Parity_Hubbard.N1.to(float) | ||
N = N0 + N1 | ||
|
||
state.hamiltonians["vertical_bond"] = -t * CSCS + Delta * tet.common_tensor.Parity_Hubbard.singlet.to(float) | ||
state.hamiltonians["horizontal_bond"] = -t * CSCS + Delta * tet.common_tensor.Parity_Hubbard.singlet.to(float) | ||
state.hamiltonians["single_site"] = -mu * N | ||
return state | ||
|
||
|
||
def abstract_lattice(L1, L2, D, t, Delta, mu): | ||
""" | ||
Create BCS model lattice. | ||
Parameters | ||
---------- | ||
L1, L2 : int | ||
The lattice size. | ||
D : int | ||
The cut dimension. | ||
t, Delta : float | ||
BCS model parameters. | ||
mu : float | ||
chemical potential. | ||
""" | ||
state = tet.AbstractLattice(abstract_state(L1, L2, t, Delta, mu)) | ||
D0 = D // 2 | ||
D1 = D - D0 | ||
state.virtual_bond["R"] = state.virtual_bond["D"] = [(False, D0), (True, D1)] | ||
|
||
return state |