def readout(q, r):
"""C matrix to decode a delay of r*theta from the delay state for theta.
``r`` is a ratio between 0 (``t=0``) and 1 (``t=-theta``).
"""
c = np.zeros(q)
for i in range(q):
j = np.arange(i+1, dtype=np.float64)
c[q-1-i] += 1 / binom(q, i) * np.sum(
binom(q, j) * binom(2*q - 1 - j, i - j) * (-r)**(i - j))
return c
评论列表
文章目录