File: wavevector.scm

package info (click to toggle)
mpb 1.11.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,856 kB
  • sloc: ansic: 13,270; javascript: 9,901; makefile: 212; lisp: 44; sh: 4
file content (35 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
; Code to output the data needed for a wavevector diagram at a grid of
; k points, suitable for plotting with a contour-plot program.

(define (kgrid kx-min kx-max ky-min ky-max nkx nky)
  (map (lambda (kx)
	 (interpolate nky (list (vector3 kx ky-min) (vector3 kx ky-max))))
       (interpolate nkx (list kx-min kx-max))))

; output a bunch of lines of the form:
; kgrid:, band#, kx, frequencies at kys...
; Frequencies above the light cone omega > c |k| / n-lightcone are
; excluded (multiplied by -1); set n-lightcone = 0 to disable this.
(define (wavevector-diagram kgrid parity n-lightcone)
  (map (lambda (kylist)
	 (set! k-points kylist)
	 (run-parity parity true)
	 (map
	  (lambda (band)
	    (print "kgrid:, " band ", " (vector3-x (car kylist)))
	    (map (lambda (freqs k) 
		   (print ", " 
			  (* (if (and (positive? n-lightcone)
				      (> (list-ref freqs (- band 1))
					 (* n-lightcone
					    (vector3-norm 
					     (reciprocal->cartesian k)))))
				 -1
				 1)
			     (list-ref freqs (- band 1)))))
		 all-freqs k-points)
	    (print "\n"))
	  (arith-sequence 1 1 num-bands)))
	 kgrid))