10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Lowercase in ocaml

This commit is contained in:
Anthony Scemama 2015-07-24 11:23:54 +02:00
parent b6d8531583
commit 95cf564898
4 changed files with 14 additions and 82 deletions

View File

@ -150,12 +150,12 @@ end = struct
let to_string = function let to_string = function
| Huckel -> \"Huckel\" | Huckel -> \"Huckel\"
| HCore -> \"Hcore\" | HCore -> \"HCore\"
let of_string s = let of_string s =
match s with match (String.lowercase s) with
| \"Huckel\" -> Huckel | \"huckel\" -> Huckel
| \"Hcore\" -> HCore | \"hcore\" -> HCore
| _ -> failwith (\"Wrong Guess type : \"^s) | _ -> failwith (\"Wrong Guess type : \"^s)
end end
@ -176,10 +176,10 @@ end = struct
| Write -> \"Write\" | Write -> \"Write\"
| None -> \"None\" | None -> \"None\"
let of_string s = let of_string s =
match s with match (String.lowercase s) with
| \"Read\" -> Read | \"read\" -> Read
| \"Write\" -> Write | \"write\" -> Write
| \"None\" -> None | \"none\" -> None
| _ -> failwith (\"Wrong IO type : \"^s) | _ -> failwith (\"Wrong IO type : \"^s)
end end

View File

@ -127,7 +127,7 @@ def dict_module_genelogy_path(d_module_genelogy):
def get_l_module_with_ezfio_cfg(): def get_l_module_with_ezfio_cfg():
""" """
Return all the module who have a EZFIO.cfg Return all the modules that have a EZFIO.cfg
""" """
from os import listdir from os import listdir
from os.path import isfile from os.path import isfile
@ -734,7 +734,7 @@ def create_build_ninja_module(path_module):
l_string += ["rule make_all_binaries", l_string += ["rule make_all_binaries",
" command = ninja -f {0}".format(ROOT_BUILD_NINJA), " command = ninja -f {0}".format(ROOT_BUILD_NINJA),
" pool = console", " description = Compile all the module", " pool = console", " description = Compiling all modules",
""] ""]
l_string += ["rule make_clean", " command = module_handler.py clean {0}".format(path_module.rel), l_string += ["rule make_clean", " command = module_handler.py clean {0}".format(path_module.rel),
@ -761,7 +761,7 @@ def create_build_ninja_global(l_module):
l_string += ["rule make_all_binaries", l_string += ["rule make_all_binaries",
" command = ninja -f {0}".format(ROOT_BUILD_NINJA), " command = ninja -f {0}".format(ROOT_BUILD_NINJA),
" pool = console", " description = Compile all the module", " pool = console", " description = Compiling all modules",
""] ""]
l_string += ["rule make_clean", l_string += ["rule make_clean",

View File

@ -30,7 +30,7 @@ p = re.compile(ur'\|(\d+)><\d+\|')
def get_pseudo_str(l_atom): def get_pseudo_str(l_atom):
""" """
Run EMSL_local for geting the str of the speudo potential Run EMSL_local for getting the str of the pseudo potential
str_ele : str_ele :
Element Symbol: Na Element Symbol: Na

View File

@ -14,12 +14,13 @@ integer*8 function spin_det_search_key(det,Nint)
END_DOC END_DOC
integer, intent(in) :: Nint integer, intent(in) :: Nint
integer(bit_kind), intent(in) :: det(Nint) integer(bit_kind), intent(in) :: det(Nint)
integer(bit_kind), parameter :: unsigned_shift = not(huge(1_bit_kind)) ! 100...00
integer :: i integer :: i
spin_det_search_key = det(1) spin_det_search_key = det(1)
do i=2,Nint do i=2,Nint
spin_det_search_key = ieor(spin_det_search_key,det(i)) spin_det_search_key = ieor(spin_det_search_key,det(i))
enddo enddo
spin_det_search_key = iand(huge(det(1)),spin_det_search_key) spin_det_search_key = spin_det_search_key-unsigned_shift
end end
@ -347,53 +348,6 @@ subroutine write_spindeterminants
call ezfio_set_spindeterminants_psi_coef_matrix_rows(psi_svd_matrix_rows) call ezfio_set_spindeterminants_psi_coef_matrix_rows(psi_svd_matrix_rows)
call ezfio_set_spindeterminants_psi_coef_matrix_columns(psi_svd_matrix_columns) call ezfio_set_spindeterminants_psi_coef_matrix_columns(psi_svd_matrix_columns)
! integer :: n_svd_coefs
! double precision :: norm, f
! f = 1.d0/dble(N_states)
! norm = 1.d0
! do n_svd_coefs=1,N_det_alpha_unique
! do k=1,N_states
! norm -= psi_svd_coefs(n_svd_coefs,k)*psi_svd_coefs(n_svd_coefs,k)
! enddo
! if (norm < 1.d-4) then
! exit
! endif
! enddo
! n_svd_coefs -= 1
! call ezfio_set_spindeterminants_n_svd_coefs(n_svd_coefs)
!
! double precision, allocatable :: dtmp(:,:,:)
! allocate(dtmp(N_det_alpha_unique,n_svd_coefs,N_states))
! do k=1,N_states
! do j=1,n_svd_coefs
! do i=1,N_det_alpha_unique
! dtmp(i,j,k) = psi_svd_alpha(i,j,k)
! enddo
! enddo
! enddo
! call ezfio_set_spindeterminants_psi_svd_alpha(dtmp)
! deallocate(dtmp)
!
! allocate(dtmp(N_det_beta_unique,n_svd_coefs,N_states))
! do k=1,N_states
! do j=1,n_svd_coefs
! do i=1,N_det_beta_unique
! dtmp(i,j,k) = psi_svd_beta(i,j,k)
! enddo
! enddo
! enddo
! call ezfio_set_spindeterminants_psi_svd_beta(dtmp)
! deallocate(dtmp)
!
! allocate(dtmp(n_svd_coefs,N_states,1))
! do k=1,N_states
! do j=1,n_svd_coefs
! dtmp(j,k,1) = psi_svd_coefs(j,k)
! enddo
! enddo
! call ezfio_set_spindeterminants_psi_svd_coefs(dtmp)
! deallocate(dtmp)
end end
@ -420,28 +374,6 @@ BEGIN_PROVIDER [ double precision, psi_svd_matrix_values, (N_det,N_states) ]
PROVIDE psi_coef_sorted_bit PROVIDE psi_coef_sorted_bit
! l=0
! do j=1,N_det_beta_unique
! do k=1,N_int
! tmp_det(k,2) = psi_det_beta_unique(k,j)
! enddo
! do i=1,N_det_alpha_unique
! do k=1,N_int
! tmp_det(k,1) = psi_det_alpha_unique(k,i)
! enddo
! idx = get_index_in_psi_det_sorted_bit(tmp_det,N_int)
! if (idx > 0) then
! l += 1
! psi_svd_matrix_rows(l) = i
! psi_svd_matrix_columns(l) = j
! do k=1,N_states
! psi_svd_matrix_values(l,k) = psi_coef_sorted_bit(idx,k)
! enddo
! endif
! enddo
! enddo
! ASSERT (l == N_det)
integer, allocatable :: iorder(:), to_sort(:) integer, allocatable :: iorder(:), to_sort(:)
integer, external :: get_index_in_psi_det_alpha_unique integer, external :: get_index_in_psi_det_alpha_unique
integer, external :: get_index_in_psi_det_beta_unique integer, external :: get_index_in_psi_det_beta_unique