# Ken Chan 時光機 1.4.1

.

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

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

.

.

# 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

.

.

# 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

.

.

# 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.

.

.

# 凌晨舊戲 2.2

.

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

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

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

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

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

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

.

.

# 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

.

.

# 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

.

.

# 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

.

.

Posted in OCD

# Ken Chan 時光機 1.3

.

— Me@2018-10-31 09:39:05 AM

.

.

# funcall

In Common Lisp, apply can take any number of arguments, and the function given first will be applied to the list made by consing the rest of the arguments onto the list given last. So the expression

(apply #’+ 1 ’(2))

is equivalent to the preceding four. If it is inconvenient to give the arguments as
a list, we can use funcall, which differs from apply only in this respect. This expression

(funcall #’+ 1 2)

has the same effect as those above.

— p.13

— On Lisp

— Paul Graham

.

Exercise 7.1

Define funcall.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.


(defmacro our-funcall (f &rest p)
(apply ,f (list ,@p)))



— Me@2018-10-30 03:24:05 PM

.

.

.

# Problem 14.5b2

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

.

(b) Consider the left R’ sector. Write the precise mass-squared formula with normal-ordered oscillators and the appropriate normal-ordering constant.

We have 32 zero modes $\displaystyle{\lambda_0^A}$ and 16 linear combinations behave as creation operators.

As usual half of the ground states have $\displaystyle{(-1)^{F_L} = +1}$ and the other half have $\displaystyle{(-1)^{F_L} = -1}$.

Let $\displaystyle{|R_\alpha \rangle_L}$ denote ground states with $\displaystyle{(-1)^{F_L} = +1}$.

How many ground states $\displaystyle{|R_\alpha \rangle_L}$ are there?

~~~

— 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}}

p.315 “Being zero modes, these creation operators do not contribute to the mass-squared of the states. Postulating a unique vacuum $\displaystyle{|0 \rangle}$, the creation operators allow us to construct $\displaystyle{16 = 2^4}$ degenerate Ramond ground states.”

Following the same logic:

Postulating a unique vacuum $\displaystyle{|0 \rangle}$, the creation operators allow us to construct $\displaystyle{2^{16}}$ degenerate Ramond ground states.

Therefore, there are $\displaystyle{2^{15}}$ ground states $\displaystyle{|R_\alpha \rangle_L}$.

— This answer is my guess. —

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

.

.

# Visualizing higher dimensions

The trick of visualizing higher dimension is: not to visualize it.

— Wikipedia

— Me@2011.08.19

.

Besides trying to visualize, there are other methods to understand higher dimensions.

— Me@2018-10-28 04:28:01 PM

.

.

What is the meaning of visualization?

— Me@2018-09-02 4:35 pm

.

feel ~ receive all the data at once

(This definition is not totally correct, but is useful in the meantime.)

visual ~ feel at once through eyes

.

you can visualize a 3D object ~ you can see all of a 3D object at once

you cannot visualize a 4D object ~ you cannot see all of a 4D object at once

.

Actually, you can only visualize a 2D object, such as a square.

You cannot visualize a 3D object, such as a cube.

That’s why the screen of any computer monitor is 2 dimensional, not 3.

— Me@2018-10-28 04:32:41 PM

.

.

# A pretty girl, 2

Women are directly fitted for acting as the nurses and teachers of our early childhood by the fact that they are themselves childish, frivolous and short-sighted; in a word, they are big children all their life long–a kind of intermediate stage between the child and the full-grown man, who is man in the strict sense of the word. See how a girl will fondle a child for days together, dance with it and sing to it; and then think what a man, with the best will in the world, could do if he were put in her place.

— Of Women

— Arthur Schopenhauer

.

When the elderly Schopenhauer sat for a sculpture portrait by the Prussian sculptor Elisabet Ney in 1859, he was much impressed by the young woman’s wit and independence, as well as by her skill as a visual artist. After his time with Ney, he told Richard Wagner’s friend Malwida von Meysenbug, “I have not yet spoken my last word about women. I believe that if a woman succeeds in withdrawing from the mass, or rather raising herself above the mass, she grows ceaselessly and more than a man.

— Wikipedia on Arthur Schopenhauer

.

Anybody can look at a pretty girl and see a pretty girl. An artist can look at a pretty girl and see the old woman she will become. A better artist can look at an old woman and see the pretty girl that she used to be. But a great artist — a master — and that is what Auguste Rodin was — can look at an old woman, portray her exactly as she is… and force the viewer to see the pretty girl she used to be…. and more than that, he can make anyone with the sensitivity of an armadillo, or even you, see that this lovely young girl is still alive, not old and ugly at all, but simply prisoned inside her ruined body. He can make you feel the quiet, endless tragedy that there was never a girl born who ever grew older than eighteen in her heart…. no matter what the merciless hours have done to her. Look at her, Ben. Growing old doesn’t matter to you and me; we were never meant to be admired — but it does to them. Look at her! (UC)

— Robert A. Heinlein

.

.

2018.10.27 Saturday ACHK

# 凌晨舊戲 2

.

（問：你閱讀過很多有關「瀕死經驗」的文章？）

（問：那你怎樣分辨，「瀕死經驗」的文章之中，哪些是真，哪些為假？）

.

.

——

（問：那亦可能只是你的誤會。按常理，程度較低的人不會知道，所謂「程度高的人或說話」的真假。

——

——

（留意，這裡的「判別其真假」只是「評價其可信度」的簡寫。剛才你也提到，要百分百地證明，某些言論是真的，是沒有可能的。）

.

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

— Me@2018-10-26 08:48:21 PM

.

.

# A Road to Common Lisp

tumba 57 days ago [-]

My advice is this: as you learn Common Lisp and look for libraries, try to suppress the voice in the back of your head that says “This project was last updated six years ago? That’s probably abandoned and broken.” The stability of Common Lisp means that sometimes libraries can just be done, not abandoned, so don’t dismiss them out of hand.

I have found this to be true in my own experience. The perception of stagnation is, however, a common initial objection to folks working in CL for the first time.

mike_ivanov 57 days ago [-]

My personal problem with CL libraries is not that, but rather the lack of documentation. More often than not, there is no documentation at all, not even a readme file.. It feels like some library authors simply don’t care. I’d say this attitude has a negative impact on how people perceive viability of those libraries — and by extension, of the language.

armitron 56 days ago [-]

A lot of libraries that don’t have separate documentation in the form of HTML/PDF/README.. are actually well-documented at source level in the form of docstrings.
Since Common Lisp is an interactive programming language and is meant to be used interactively (think Smalltalk, not Python) it is common practice to (interactively) load a library in a Common Lisp image and explore it (interactively). One can see what symbols are exported from packages, what these symbols are used for and (interactively) retrieve their documentation. All of this takes place within the editing environment (ideally Emacs) in a rapid feedback loop (again think Smalltalk, not Python) that feels seamless and tremendously empowering.

stevelosh 56 days ago [-]

I agree with this — it’s a real problem. My only solution has been to try to be the change I want to see in the world and document all of my own libraries before I officially release them.

— A Road to Common Lisp

— Hacker News

.

.

2018.10.24 Wednesday ACHK

# Problem 14.5b

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

.

(b) Consider the left R’ sector. Write the precise mass-squared formula with normal-ordered oscillators and the appropriate normal-ordering constant.

~~~

— This answer is my guess. —

The naive mass formula in the left R’ sector:

\displaystyle{ \begin{aligned} \alpha' M_L^2 &= \frac{1}{2} \sum_{n \ne 0} \bar \alpha_{-n}^I \bar \alpha_{n}^I + \frac{1}{2} \sum_{n \ne 0} n \lambda_{-n}^A \lambda_n^A \\ &= \left[ \frac{-1}{3} + \sum_{n \in \mathbf{Z}^+} \bar \alpha_{-n}^I \bar \alpha_{n}^I \right] + \frac{1}{2} \sum_{n \ne 0} n \lambda_{-n}^A \lambda_n^A \\ \end{aligned}}

.

\displaystyle{ \begin{aligned} \frac{1}{2} \sum_{n \ne 0} n \lambda_{-n}^A \lambda_n^A &= \frac{1}{2} \sum_{n = -1, -2, ...} n \lambda_{-n}^A \lambda_n^A + \frac{1}{2} \sum_{n = 1, 2, ...} n \lambda_{-n}^A \lambda_n^A \\ \end{aligned}}

p.316 Equation (14.51):

\displaystyle{ \begin{aligned} \frac{1}{2} \sum_{n = -1. -2, ...} n \lambda_{-n}^A \lambda_n^A &= \frac{1}{2} \sum_{n = 1. 2, ...} n \lambda_{-n}^A \lambda_{n}^A + \frac{1}{24} (D - 2) \\ \end{aligned}}

\displaystyle{ \begin{aligned} \frac{1}{2} \sum_{n \ne 0} n \lambda_{-n}^A \lambda_n^A &= \left[ \frac{1}{2} \sum_{n = 1. 2, ...} n \lambda_{-n}^A \lambda_{n}^A + \frac{1}{24} \left[(D - 2)\right]_A \right] + \frac{1}{2} \sum_{n = 1, 2, ...} n \lambda_{-n}^A \lambda_n^A \\ &= \sum_{n = 1. 2, ...} n \lambda_{-n}^A \lambda_{n}^A + \frac{32}{24} \\ &= \sum_{n = 1. 2, ...} n \lambda_{-n}^A \lambda_{n}^A + \frac{4}{3} \\ \\ \end{aligned}}

.

\displaystyle{ \begin{aligned} \alpha' M_L^2 &= \left[ \frac{-1}{3} + \sum_{n \in \mathbf{Z}^+} \bar \alpha_{-n}^I \bar \alpha_{n}^I \right] + \frac{1}{2} \sum_{n \ne 0} n \lambda_{-n}^A \lambda_n^A \\ &= \left[ \frac{-1}{3} + \sum_{n \in \mathbf{Z}^+} \bar \alpha_{-n}^I \bar \alpha_{n}^I \right] + \left[ \sum_{n = 1. 2, ...} n \lambda_{-n}^A \lambda_{n}^A + \frac{4}{3} \right] \\ &= 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}}

.

\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}}

— This answer is my guess. —

.

.

# Relational quantum mechanics

.

Relational quantum mechanics (RQM) is an interpretation of quantum mechanics which treats the state of a quantum system as being observer-dependent, that is, the state is the relation between the observer and the system. This interpretation was first delineated by Carlo Rovelli in a 1994 preprint, and has since been expanded upon by a number of theorists. It is inspired by the key idea behind special relativity, that the details of an observation depend on the reference frame of the observer, and uses some ideas from Wheeler on quantum information.

,,,

Relational solution

In RQM, an interaction between a system and an observer is necessary for the system to have clearly defined properties relative to that observer. Since the two measurement events take place at spacelike separation, they do not lie in the intersection of Alice’s and Bob’s light cones. Indeed, there is no observer who can instantaneously measure both electrons’ spin.

The key to the RQM analysis is to remember that the results obtained on each “wing” of the experiment only become determinate for a given observer once that observer has interacted with the other observer involved. As far as Alice is concerned, the specific results obtained on Bob’s wing of the experiment are indeterminate for her, although she will know that Bob has a definite result. In order to find out what result Bob has, she has to interact with him at some time ${\displaystyle t_{3}}$ in their future light cones, through ordinary classical information channels.

The question then becomes one of whether the expected correlations in results will appear: will the two particles behave in accordance with the laws of quantum mechanics? Let us denote by ${\displaystyle M_{A}(\alpha )}$ the idea that the observer ${\displaystyle A}$ (Alice) measures the state of the system ${\displaystyle \alpha}$ (Alice’s particle).

So, at time ${\displaystyle t_{2}}$, Alice knows the value of ${\displaystyle M_{A}(\alpha )}$: the spin of her particle, relative to herself. But, since the particles are in a singlet state, she knows that

${\displaystyle M_{A}(\alpha )+M_{A}(\beta )=0,}$

and so if she measures her particle’s spin to be ${\displaystyle \sigma }$, she can predict that Bob’s particle ( ${\displaystyle \beta }$ ) will have spin ${\displaystyle -\sigma }$. All this follows from standard quantum mechanics, and there is no “spooky action at a distance” yet. From the “coherence-operator” discussed above, Alice also knows that if at ${\displaystyle t_{3}}$ she measures Bob’s particle and then measures Bob (that is asks him what result he got) — or vice versa — the results will be consistent:

${\displaystyle M_{A}(B)=M_{A}(\beta )}$

Finally, if a third observer (Charles, say) comes along and measures Alice, Bob, and their respective particles, he will find that everyone still agrees, because his own “coherence-operator” demands that

${\displaystyle M_{C}(A)=M_{C}(\alpha )}$ and ${\displaystyle M_{C}(B)=M_{C}(\beta )}$

while knowledge that the particles were in a singlet state tells him that

${\displaystyle M_{C}(\alpha )+M_{C}(\beta )=0.}$

Thus the relational interpretation, by shedding the notion of an “absolute state” of the system, allows for an analysis of the EPR paradox which neither violates traditional locality constraints, nor implies superluminal information transfer, since we can assume that all observers are moving at comfortable sub-light velocities. And, most importantly, the results of every observer are in full accordance with those expected by conventional quantum mechanics.

— Wikipedia on Relational quantum mechanics

.

.

2018.10.22 Monday ACHK