This file contains hidden or 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
using FFTW | |
const MAX_THREADS = Threads.nthreads() | |
println("$(MAX_THREADS) threads") | |
N = 128 | |
M = 40 | |
println("N=$N, M=$M") |
This file contains hidden or 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
(require 'latex nil t) | |
;; Math insertion in julia. Use it with | |
(defun julia-math-insert (s) | |
"Inserts math symbol given by `s'" | |
(when s | |
(let ((sym (gethash (concat "\\" s) julia-latexsubs))) | |
(when sym | |
(insert sym))))) |
This file contains hidden or 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
import LinearAlgebra.BLAS | |
const libblas = Base.libblas_name | |
const liblapack = Base.liblapack_name | |
import LinearAlgebra | |
import LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1, axpy! | |
import Libdl |
This file contains hidden or 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
import LinearAlgebra.BLAS | |
const libblas = Base.libblas_name | |
const liblapack = Base.liblapack_name | |
import LinearAlgebra | |
import LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1, axpy! | |
import Libdl |
This file contains hidden or 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
diff --git a/src/solvers/anderson.jl b/src/solvers/anderson.jl | |
index 0d47b6a..60dc122 100644 | |
--- a/src/solvers/anderson.jl | |
+++ b/src/solvers/anderson.jl | |
@@ -42,8 +42,8 @@ AndersonCache(df, ::Anderson{0}) = | |
@views function anderson_(df::Union{NonDifferentiable, OnceDifferentiable}, | |
initial_x::AbstractArray{T}, | |
- xtol::T, | |
- ftol::T, |
This file contains hidden or 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
using Random | |
using LinearAlgebra | |
function ortho(X) | |
Array(qr(X).Q) | |
end | |
function align(X,Y) | |
# returns an orthogonal combination X * c with c unitary such that X*c is closest to Y | |
proj = X'Y |
This file contains hidden or 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
using Random | |
using LinearAlgebra | |
function ortho(X) | |
Array(qr(X).Q) | |
end | |
function align(X,Y) | |
# returns an orthogonal combination X * c with c unitary such that X*c is closest to Y | |
proj = X'Y |
This file contains hidden or 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
using Random | |
using LinearAlgebra | |
function ortho(X) | |
Array(qr(X).Q) | |
end | |
function align(X,Y) | |
# returns an orthogonal combination X * c with c unitary such that X*c is closest to Y | |
proj = X'Y |
This file contains hidden or 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
diff --git a/share/julia/stdlib/v1.0/REPL/src/REPLCompletions.jl b/share/julia/stdlib/v1.0/REPL/src/REPLCompletions.jl | |
index 3a3e507..5b1db55 100644 | |
--- a/share/julia/stdlib/v1.0/REPL/src/REPLCompletions.jl | |
+++ b/share/julia/stdlib/v1.0/REPL/src/REPLCompletions.jl | |
@@ -696,7 +696,47 @@ function completions(string, pos, context_module=Main)::Completions | |
s = string[startpos:pos] | |
end | |
end | |
+ | |
+ # Completion of strings like si(1.0) with pos after si should only |
This file contains hidden or 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
using StaticArrays | |
using PyPlot | |
const gap = 0.0 # gap at the Dirac points. 0 for graphene | |
const n = 80 # number of k point per direction | |
const t2 = 0.0 | |
#http://www-personal.umich.edu/~sunkai/teaching/Fall_2014/Chapter6.pdf | |
# K = 1/3,-1/3 |