Incorrect evaluation by Composite Quantum Gate
조회 수: 5 (최근 30일)
이전 댓글 표시
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Quantum Mechanics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!