Re: about H field output at k point
"Steven G. Johnson" <[email protected]> Wed, 15 Jun 2011 09:31:13 -0400
| Newsgroups | gmane.comp.science.photonic-bands |
|---|---|
| Message-ID | <[email protected]> |
On Jun 15, 2011, at 5:03 AM, [email protected] wrote: > Thank you very much for your reply. > > I still dont know why i cant get the output if i insist on using the > output command: > "(run-te (output-at-kpoint (vector3 0.1 0 0) > fix-hfield-phase output-hfield-z))" > but i found a solution for the problem by using (list-ref k-points 1) > instead of (vector3 0.1 0 0), namly: > "(run-te (output-at-kpoint (list-ref k-points 1) > fix-hfield-phase output-hfield-z))" > it confused me very much. Oh, I know what happened. The problem is rounding errors. When you create the k-point list with "interpolate", the point (0.1,0,0) is generated with a bit of rounding error. When you enter (0.1,0,0) manually there is also a rounding (since 0.1 is not exactly representable in binary floating point), but it is a different one, so "0.1" in the two cases differs slightly. On my computer, it worked because I have updated my version of MPB to use "vector3-close?" in output-at-kpoint instead of "vector3=", so my version allows the vectors to differ slightly by rounding errors. I should probably try to release a new version of MPB this summer; a bunch of little improvements have piled up since the last release. Steven