Incorrect evaluation by Composite Quantum Gate
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Francisco Solis
il 6 Ott 2024
Commentato: Francisco Solis
il 7 Ott 2024
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 Commenti
Risposta accettata
Christine Tobler
il 7 Ott 2024
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)];
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Quantum Mechanics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!