# Ken Chan 時光機 1.4.1

.

Ken Chan 說：「你們現在會盤算，在會考中，各科太概會有什麼目標，奪取什麼等級的成績。但是，我當年全部科目，只有一個目標，就是要『攞 full』」。

— Me@2018-11-18 10:06:43 PM

.

.

2018.11.18 Sunday (c) All rights reserved by ACHK

# defmacro, 2

Defining the defmacro function using only LISP primitives?

.

McCarthy’s Elementary S-functions and predicates were

atom, eq, car, cdr, cons

.

He then went on to add to his basic notation, to enable writing what he called S-functions:

quote, cond, lambda, label

.

On that basis, we’ll call these “the LISP primitives”…

How would you define the defmacro function using only these primitives in the LISP of your choice?

edited Aug 21 ’10 at 2:47
Isaac

asked Aug 21 ’10 at 2:02
hawkeye

.

Every macro in Lisp is just a symbol bound to a lambda with a little flag set somewhere, somehow, that eval checks and that, if set, causes eval to call the lambda at macro expansion time and substitute the form with its return value. If you look at the defmacro macro itself, you can see that all it’s doing is rearranging things so you get a def of a var to have a fn as its value, and then a call to .setMacro on that var, just like core.clj is doing on defmacro itself, manually, since it doesn’t have defmacro to use to define defmacro yet.

– dreish Aug 22 ’10 at 1:40

.

.

2018.11.17 Saturday (c) All rights reserved by ACHK

# Problem 14.5c

Counting states in heterotic SO(32) string theory | A First Course in String Theory

.

At any mass level $\displaystyle{\alpha' M^2 = 4k}$ of the heterotic string, the spacetime bosons are obtained by “tensoring” all the left states (NS’+ and R’+) with $\displaystyle{\alpha' M_L^2 = k}$ with the right-moving NS+ states with $\displaystyle{\alpha' M_R^2 = k}$.

~~~

In heterotic (closed) string theory, there are left-moving part and right-moving part. Then, what is the meaning of “at any mass level $\displaystyle{\alpha' M^2 = 4k}$ of the heterotic string”?

— Me@2018-11-11 03:44:18 PM

.

Type IIA/B closed superstrings

p.322

In closed superstring theories spacetime bosons arise from the (NS, NS) sector and also from the (R, R) sector, since this sector is “doubly” fermionic. The spacetime fermions arise from the (NS, R) and (R, NS) sectors.

p.322

$\displaystyle{\alpha' M_L^2 = \alpha' M_R^2}$

$\displaystyle{\frac{1}{2} \alpha' M^2 = \alpha' M_L^2 + \alpha' M_R^2}$

$\displaystyle{\alpha' M^2 = 2 \left( \alpha' M_L^2 + \alpha' M_R^2 \right) = 4 \alpha' M_L^2}$

These are the reasons that any mass level of the heterotic string is always in the form $\displaystyle{\alpha' M^2 = 4k}$.

— Me@2018-11-12 03:09:11 PM

.

Equation (14.77):

p.322

closed string sectors: (NS, NS), (NS, R), (R, NS), (R, R)

$\text{type IIA}:~~~(NS+, NS+), ~(NS+, R+),~ (R-, NS+), ~ (R-, R+)$

$\text{type IIB}:~~~(NS+, NS+), ~(NS+, R-),~ (R-, NS+), ~ (R-, R-)$

What is the difference between Type IIA/B closed superstrings and heterotic SO(32) strings?

— Me@2018-11-12 03:15:46 PM

.

The five consistent superstring theories are:

• The type I string has one supersymmetry in the ten-dimensional sense (16 supercharges). This theory is special in the sense that it is based on unoriented open and closed strings, while the rest are based on oriented closed strings.
• The type II string theories have two supersymmetries in the ten-dimensional sense (32 supercharges). There are actually two kinds of type II strings called type IIA and type IIB. They differ mainly in the fact that the IIA theory is non-chiral (parity conserving) while the IIB theory is chiral (parity violating).
• The heterotic string theories are based on a peculiar hybrid of a type I superstring and a bosonic string. There are two kinds of heterotic strings differing in their ten-dimensional gauge groups: the heterotic E8×E8 string and the heterotic SO(32) string. (The name heterotic SO(32) is slightly inaccurate since among the SO(32) Lie groups, string theory singles out a quotient Spin(32)/Z2 that is not equivalent to SO(32).)

— Wikipedia on Superstring theory

.

.

2018.11.15 Thursday (c) All rights reserved by ACHK

# Detecting a photon

In the double-slit experiments, how to detect a photon without destroying it?

— Me@2018-11-10 08:07:29 PM

.

Artlav: I’ve been thinking about the double slit experiment – the one with single photons going thru two slits forming an interference pattern never the less. Now, one thing i was unable to find clarification for is the claim that placing a detector even in just one of the slits to find out thru which slit a photon passed will result in the disappearance of the interference pattern. The question is – how does such detector work? How can one detect a photon without destroying it?

Cthugha (Science Advisor): Well, in the kind of experiment you describe, the photon will usually be destroyed by detecting it. However, in some cases it is possible to detect photons without destroying them. Usually one uses some resonator, for example some cavity, in which photons go back and forth and prepare some atom in a very well defined spin state. Now the atom falls through the cavity perpendicular to the photons moving back and forth and the spin state of the atom after leaving the cavity will depend on the number of photons because the spin precession will be a bit faster in presence of photons. If you do this several times, you will get a nondestructive photon number measurement. However, these are so called weak measurements, so this means you do not change the photon states if you are in a photon number eigenstate already. The first measurement however might change the photon state from some undefined state to a photon number eigenstate.

Reference: physicsforums double-slit-experiment-counter.274914

.

.

2018.11.10 Saturday ACHK

# Intelligence

Many people do not like beauty.

Many people do not like to be intelligent.

— Me@2011.08.23

.

Intelligence implies responsibilities. That’s why most people resist intelligence.

.

.

2018.11.09 Friday (c) All rights reserved by ACHK

# 凌晨舊戲 2.2

.

（問：但是，道理又怎樣為之「境界極高」呢？）

（以下的「瀕死經驗者」，是「自稱經歷瀕死經驗人仕」的簡稱。同理，「瀕死經驗後」，是「所宣稱的瀕死經驗後」的縮寫。）

（問：那樣，你又如何呢？

（問：那樣，你又可否舉例，哪些是帶來「好果」的真道理，而哪些卻是帶在「壞果」的假道理？）

（問：即是話，要足夠老？）

— Me@2018-11-08 11:24:23 AM

.

.

2018.11.08 Thursday (c) All rights reserved by ACHK

# defmacro

SLIME, 2

.

Alt + Up/Down

Switch between the editor and the REPL

— Me@2018-11-07 05:57:54 AM

~~~

defmacro

.


(defmacro our-expander (name) (get ,name 'expander))

(defmacro our-defmacro (name parms &body body)
(let ((g (gensym)))
(progn
(setf (our-expander ',name)
#'(lambda (,g)
(block ,name
(destructuring-bind ,parms (cdr ,g)
,@body))))
',name)))

(defun our-macroexpand-1 (expr)
(if (and (consp expr) (our-expander (car expr)))
(funcall (our-expander (car expr)) expr)
expr))



.

A formal description of what macros do would be long and confusing. Experienced programmers do not carry such a description in their heads anyway. It’s more convenient to remember what defmacro does by imagining how it would be defined.

The definition in Figure 7.6 gives a fairly accurate impression of what macros do, but like any sketch it is incomplete. It wouldn’t handle the &whole keyword properly. And what defmacro really stores as the macro-function of its first argument is a function of two arguments: the macro call, and the lexical environment in which it occurs.

— p.95

— A MODEL OF MACROS

— On Lisp

— Paul Graham

.


(our-defmacro sq (x)
(* ,x ,x))



After using our-defmacro to define the macro sq, if we use it directly,


(sq 2)



we will get an error.

The function COMMON-LISP-USER::SQ is undefined. [Condition of type UNDEFINED-FUNCTION]

Instead, we should use (eval (our-macroexpand-1 ':


(eval (our-macroexpand-1 '(sq 2)))

`

— Me@2018-11-07 02:12:47 PM

.

.

2018.11.07 Wednesday (c) All rights reserved by ACHK

# Problem 14.5b2

Counting states in heterotic SO(32) string theory | A First Course in String Theory

.

(b) … Keep only states with $\displaystyle{(-1)^{F_L}=+1}$; this defines the left R’+ sector.

Write explicitly and count the states we keep for the two lowest mass levels, indicating the corresponding values of $\displaystyle{\alpha' M_L^2}$. [This is a shorter list.]

~~~

— This answer is my guess. —

\displaystyle{ \begin{aligned} \alpha' M_L^2 &= 1 + \sum_{n \in \mathbf{Z}^+} \left( \bar \alpha_{-n}^I \bar \alpha_{n}^I + n \lambda_{-n}^A \lambda_{n}^A \right) \\ \end{aligned}}

If we define $N^\perp$ in a way similar to equation (14.37), we have

\displaystyle{ \begin{aligned} \alpha' M_L^2 &= 1 + N^\perp \\ \end{aligned}}

.

\displaystyle{\begin{aligned} (-1)^{F_L} |R_\alpha \rangle_L &= + |R_\alpha \rangle_L \\ (-1)^{F_L} |R_\alpha \rangle_R &= - |R_\alpha \rangle_L \\ \end{aligned}}

.

\displaystyle{\begin{aligned} \alpha'M^2=1,~~~&N^\perp = 0:~~~~~&|R_\alpha \rangle_L \\ \alpha'M^2=2,~~~&N^\perp = 1:~~~~~&\alpha_{-1} |R_\alpha \rangle_L, \lambda_{-1} |R_\alpha \rangle_R \\ \end{aligned}}

— This answer is my guess. —

— Me@2018-11-06 03:39:15 PM

.

.

2018.11.06 Tuesday (c) All rights reserved by ACHK

# Monty Hall problem 1.6

Sasha Volokh (2015) wrote that “any explanation that says something like ‘the probability of door 1 was 1/3, and nothing can change that…’ is automatically fishy: probabilities are expressions of our ignorance about the world, and new information can change the extent of our ignorance.”

— Wikipedia on Monty Hall problem

.

.

2018.11.02 Friday ACHK

# 講道理

.

— Me@2012.02.14

.

.

2018.11.01 Thursday (c) All rights reserved by ACHK

Posted in OCD