<Proof & Explain>
\((N\in\mathbb{N})\)
(Equal - Probability version)
\(\uparrow minium\ needed\ qubit\ count\)
\(|0\rangle \rightarrow \sqrt{1-\beta}|0\rangle + \sqrt{\beta}|1\rangle\)
\(7Face=4Face+2Face+1Face\)
(1)
(2)
可以丟給電腦算
操作必有誤差(目前)
width(4)
depth(10)
(After using reset())
\(or\ p_1=1\rightarrow\) 不合
(0~...)
\(N=15=5\cdot 3\)
\(\rightarrow result_1=00010\)
\(\rightarrow result_2=01000\)
\(result_1=000^c + 10^c=1\cdot 3=3\)
\(result_2=010^c+00^c=3\cdot 1=3\)
注意,我們得出的字串為一複合進位數。
在這個例子中它是一個\((5^c+3^c)\)進位的數字。
所以將會需要經過適當的轉譯
才可得出我們要的正確答案
"基於複數個有序集合乘積的複合質數進位制轉譯"
(After using reset() & factorization)
(字串優化 + \(H\ Gate\) 干涉原理)
(可能的)
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
int main() {
long long int N;
cin >> N;
stack<short> N_2;
while(N >= 2) {
N_2.push(N%2);
N = (N-(N%2))/2;
}
N_2.push(N);
vector<short> N2;
N2.push_back(0);
while(!N_2.empty()) {
N2.push_back(N_2.top());
N_2.pop();
}
vector<short> coor;
vector<short> value;
for(int i = N2.size()-2; i >= 1; i--) {
if(N2[i] == 1 && N2[i-1] == 0) {
coor.push_back(i);
short sum_pN = 0;
for(int j = N2.size()-1; j >= i; j--) if(N2[j] == 1) sum_pN++;
value.push_back(2*(sum_pN-1)-(N2.size()-i));
}
}
for(auto i : N2) cout << i << ", ";
cout << "\n";
for(auto i : coor) cout << i << ", ";
cout << "\n";
for(auto i : value) cout << i << ", ";
cout << "\n";
cout << "As for the best results: ";
short best = *max_element(value.begin(), value.end());
cout << best << " string shorter\n";
cout << "In coor: ";
for(int i = 0; i < value.size(); i++) if(value[i] == best) cout << coor[i] << ", ";
return 0;
}
N為面數,I為檢驗值\(2^{i_{N}-1}\),A為狀態陣列,Ry為旋轉數據陣列
A.push_back(1)
Ry.push_back(\(\frac{N-I}{N}\))
N -= I
A.push_back(0)
Ry.push_back(0)
I /= 2
\(N-I>=0\)?
yes
no
INI
END
if(N == 0)