Incorrect evaluation by Composite Quantum Gate

조회 수: 5 (최근 30일)
Francisco Solis
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)

채택된 답변

Christine Tobler
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 CenterFile Exchange에서 Quantum Mechanics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by