Incorrect evaluation by Composite Quantum Gate
5 ビュー (過去 30 日間)
古いコメントを表示
Francisco Solis
2024 年 10 月 6 日
コメント済み: Francisco Solis
2024 年 10 月 7 日
I found this issue in a more complex structure but I can reporduce it in a simple composite quantum gate wtih just identity gates.
The composite gate consists of 3 identity gates. On input |000> it should produce |000> but instead produces |001>. I expect this might be an issue/bug with composite gates with more than 2 qubits.
CODE:
% Issue test. The composite gate is the identity gate acting on
% 3 qubits. On input |000> it should produce the result !000>.
% Instead, it produces a mixture of |000> and |001>.
innerUGates = [idGate(1); idGate(2); xGate(3)];
innerUCircuit = quantumCircuit(innerUGates,Name="Uniform");
gates = [ compositeGate(innerUCircuit,[1,2,3])];
testQC = quantumCircuit(gates);
circfig=figure;
plot(testQC)
testS = simulate(testQC,"000")
testA = testS.Amplitudes
testf = formula(testS)
mmS = randsample(S,10);
table(mmS.Counts,mmS.Probabilities,mmS.MeasuredStates, ...
VariableNames=["Counts","Probabilities","States"]);
histofig=figure;
histogram(mmS)
0 件のコメント
採用された回答
Christine Tobler
2024 年 10 月 7 日
The issue is a typo in your code. Instead of constructing 3 identity gates, your third gate is an X gate:
innerUGates = [idGate(1); idGate(2); xGate(3)];
If you replace it with an identity gate, you will get the expected result of |000>
innerUGates = [idGate(1); idGate(2); idGate(3)];
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!