2049代码记录
Q4 表示 分母是 2的4次方。同理 Q10 表示 分母是 2的10次方。
以下是数学推导过程 10 * log10(“true energy”) in Q4 = 2^4 * 10 * log10(“true energy”)
= 160 * log10(2) * log2(“true energy”)
令 true energy = | energy | * 2^ | tot_rshifts | 且 | kLogConst | = 160 * log10(2) |
160 * log10(2) * log2(“true energy”) = | kLogConst | * log2( | energy | * 2^ | tot_rshifts | ) |
= | kLogConst | * (log2( | energy | ) + | tot_rshifts | ) |
令 | energy | = 2^14 + frac_Q15 |
kLogConst | * (log2( | energy | ) + | tot_rshifts | ) = | kLogConst | * (log2(2^14 + frac_Q15 ) + | tot_rshifts | ) |
= | kLogConst | * (log2(2^14 (1+ frac_Q15»14) ) + | tot_rshifts | ) |
= | kLogConst | * (14 + log2(1+ frac_Q15»14) + | tot_rshifts | ) |
~= | kLogConst | * (14 + frac_Q15»14 + | tot_rshifts | ) |
令 frac_Q15 = ( | energy | & 0x00003FFF) |
int16_t log2_energy = kLogEnergyIntPart;
log2_energy += (int16_t) ((energy & 0x00003FFF) » 4);
*log_energy = (int16_t)(((kLogConst * log2_energy) » 19) +
((tot_rshifts * kLogConst) >> 9));
高通滤波和低通滤波明天记录下
Lowering qubit requirements using binary codes
Introduction
Molecular Hamiltonians are known to have certain symmetries that are not taken into account by mappings like the Jordan-Wigner or Bravyi-Kitaev transform. The most notable of such symmetries is the conservation of the total number of particles in the system. Since those symmetries effectively reduce the degrees of freedom of the system, one is able to reduce the number of qubits required for simulation by utilizing binary codes (arXiv:1712.07067).
We can represent the symmetry-reduced Fermion basis by binary vectors of a set $\mathcal{V} \ni \boldsymbol{\nu}$, with $ \boldsymbol{\nu} = (\nu_0, \, \nu_1, \dots, \, \nu_{N-1} ) $, where every component $\nu_i \in \lbrace 0, 1 \rbrace $ and $N$ is the total number of Fermion modes. These binary vectors $ \boldsymbol{\nu}$ are related to the actual basis states by: $$ \left[\prod_{i=0}^{N-1} (a_i^{\dagger})^{\nu_i} \right] \left | {\text{vac}}\right\rangle \, , \left | {\omega_0}\right\rangle \otimes \left | \omega_1\right\rangle \otimes \dots \otimes \left | {\omega_{n-1}}\right\rangle \, . $$ Since $\mathcal{V}$ is a mere subset of the $N$-fold binary space, but the set of the vectors $\boldsymbol{\omega}$ spans the entire $n$-fold binary space we can assign every vector $\boldsymbol{\nu}$ to a vector $ \boldsymbol{\omega}$, such that $n<N$. This reduces the amount of qubits required by $(N-n)$. The mapping can be done by a binary code, a classical object that consists of an encoder function $\boldsymbol{e}$ and a decoder function $\boldsymbol{d}$. These functions relate the binary vectors $\boldsymbol{e}(\boldsymbol{\nu})=\boldsymbol{\omega}$, $\boldsymbol{d}(\boldsymbol{\omega})=\boldsymbol{\nu}$, such that $\boldsymbol{d}(\boldsymbol{e}(\boldsymbol{\nu}))=\boldsymbol{\nu}$. In OpenFermion, we, at the moment, allow for non-linear decoders $\boldsymbol{d}$ and linear encoders $\boldsymbol{e}(\boldsymbol{\nu})=A \boldsymbol{\nu}$, where the matrix multiplication with the $(n\times N)$-binary matrix $A$ is $(\text{mod 2})$ in every component. |
Symbolic binary functions
The non-linear binary functions for the components of the decoder are here modeled by the $\text{BinaryPolynomial}$ class in openfermion.ops. For initialization we can conveniently use strings (‘w0 w1 + w1 +1’ for the binary function $\boldsymbol{\omega} \to \omega_0 \omega_1 + \omega_1 + 1 \;\text{mod 2}$), the native data structure or symbolic addition and multiplication.
狄拉克符号 打不出来!!!! 全乱码了!!!
神奇了,矩阵伪逆符号居然显示是正确的,这个markdown编辑器功能真的是缩水啊
https://zhuanlan.zhihu.com/p/47681576
https://zhuanlan.zhihu.com/p/47682212
这里没法排版,看这里好了
https://nbviewer.jupyter.org/github/quantumlib/OpenFermion/blob/master/examples/jordan_wigner_and_bravyi_kitaev_transforms.ipynb
写$Latex$
先移到水区了,排版好了再发出来
我回头测一下这个
Latex 就是为了这种情况准备的😂