Reduced density matrix and partial trace

Posted on Wed 03 May 2017 in Physics

The reduced matrix is defined as the partial trace of the density matrix. In linear algebra and functional analysis, the partial trace is a generalization of the trace. Whereas the trace is a scalar valued function on operators, the partial trace is an operator-valued function. The partial trace has applications in quantum information and decoherence which is relevant for quantum measurement and thereby to the decoherent approaches to interpretations of quantum mechanics, including consistent histories and the relative state interpretation.


Continue reading

对换钱悖论的贝叶斯分析

Posted on Tue 04 April 2017 in ProbStat

问题的提出

现在邀请你和一位路人甲来做一个游戏:我拿出两个信封分别递给你们,并告诉你 们一个装着的钱是另一个的两倍(但不知道哪个多哪个少)。你们有一次互相交换 的机会,想交换吗?然后打开信封,看一下自己拿到的钱数(但不要让对方知道),现在还想交换吗?

——引自0x01.me

这段话似乎可以引出一个悖论:

换钱后,有一半的概率钱变成原来的两倍,一半概率钱减少到原来的一半,因此期望收益是大于零的。然而另一方面,两份钱显然是对称的,因此不可能总是由换钱带来收益。

下面我们用贝叶斯来分析这个悖论。

贝叶斯分析

假设发钱时,钱少的那个钱数取$y$的先验分布为$\rho(y)$。设某人抽到了钱数是$x$,则此时$y$的取值可以是$x$或者$x/2$。

参数$y$下$x$的分布是 $$p …


Continue reading

Blogging with Jupyter and Pelican

Posted on Thu 30 March 2017 in Computer

ipynb2pelican is used to provide jupyter ipynb support in pelican.

Installation and Setup


Continue reading

ipynb2pelican Plugin released!

Posted on Mon 27 March 2017 in Computer

Yet another Pelican Plugin for blogging with Jupyter Notebooks using MetaCell to store metadata.

Thanks to super cow power of python, we can finally publish ipynb easily! Below is the README.md from the project at this time.

The ipynb2pelican plugin provides markup for Jupyter/IPython notebooks in pelican, so …


Continue reading

Next Permutation

Posted on Fri 24 March 2017 in Puzzles

Aim: Find a larger permutation

We must move a larger number forward. So we should go from the tail to find any new number is smaller than a number behind it. If no next permutation, reverse list.

In [ ]:
def next_permutation(l):
    '''Give out the next permutation of list l
    >>> next_permutation …

Continue reading

Notes for Chapter 4. Gaussian Models

Posted on Mon 20 March 2017 in MLAPP


Continue reading

Solutions for Chapter 4. Gaussian Models

Posted on Mon 20 March 2017 in MLAPP


Continue reading

Solutions for Chapter 3 Generative models for discrete data

Posted on Thu 09 March 2017 in MLAPP


Continue reading

Notes on Chapter 2 Probability

Posted on Wed 08 March 2017 in MLAPP


Continue reading

Solutions for Chapter 2 Probability

Posted on Wed 08 March 2017 in MLAPP


Continue reading