!===========================================================
!
! File: schInfSq.f90, module schV
!
! One has to set:
!  1. V(x), the potential     
!  2. The boundary conditions for psi,psip at x=xmin and x=xmax
!
!===========================================================
module          schV
 use, intrinsic        :: iso_fortran_env
 implicit none
 integer , parameter   :: dp = real64
 real(dp)              :: energy
! ----------------------------------------------------------
 private
 public                :: V,boundary,energy
! ----------------------------------------------------------
contains
! ----------------------------------------------------------
!===========================================================
!----- potential:
 function       V(x)
  real(dp) ::   V
  real(dp) ::   x, lambda

  lambda =     2.0_dp
  V      = x*x+2.0_dp*lambda*x*x*x*x
  
 end function   V
!===========================================================
!----- boundary conditions:
 subroutine     boundary(xmin,xmax,psixmin,psipxmin,psixmax,psipxmax)
  real(dp) ::            xmin,xmax,psixmin,psipxmin,psixmax,psipxmax

  psixmin  =  exp(-0.5_dp*ABS(xmin)*ABS(xmin))
  psipxmin = -xmin*psixmin
  psixmax  =  exp(-0.5_dp*ABS(xmax)*ABS(xmax))
  psipxmax = -xmax*psixmax
!----- Initial values at xmin and xmax
 end subroutine boundary

end module      schV
!  ---------------------------------------------------------------------
!  Copyright by Konstantinos N. Anagnostopoulos (2004-2021)
!  Physics Dept., National Technical University,
!  konstant@mail.ntua.gr, www.physics.ntua.gr/~konstant
!  
!  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, version 3 of the License.
!  
!  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 Liense along
!  with this program.  If not, see <http://www.gnu.org/licenses/>.
!  -----------------------------------------------------------------------
