Skip to content

Commit

Permalink
update max-ndet kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightup1 committed Sep 15, 2023
1 parent 0f53ec0 commit c3d5d4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/char-coeff-new-indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Of course, every other solutions are obtained by the formula
±ν+2k, with k integer.
"""
function MathieuExponent(a,q;ndet::Int=20,has_img::Bool=true)
function MathieuExponent(a,q;ndet::Int=20,has_img::Bool=true,max_ndet::Int=1000)
x=(a>=0)&& sqrt(abs(a))/2%1==0
N=2*ndet+1 #matrix dimension
a,q=float.(promote(a,q))
Expand Down Expand Up @@ -217,8 +217,8 @@ function MathieuExponent(a,q;ndet::Int=20,has_img::Bool=true)
vals,vecs=eigen(H_nu)
_,idx=findmin(abs,vals)
return ν,vecs[:,idx]
elseif ndet/2<2000
MathieuExponent(a,q;ndet=2*ndet,has_img=false)
elseif ndet<max_ndet
MathieuExponent(a,q;ndet=2*ndet,has_img=false,max_ndet=max_ndet)
else
@warn "Expect real output, but the result is complex even for ndet=$ndet."
if x
Expand Down

0 comments on commit c3d5d4a

Please sign in to comment.