Incorrect evaluation by Composite Quantum Gate
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Francisco Solis
el 6 de Oct. de 2024
Comentada: Francisco Solis
el 7 de Oct. de 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 comentarios
Respuesta aceptada
Christine Tobler
el 7 de Oct. de 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)];
Más respuestas (0)
Ver también
Categorías
Más información sobre Quantum Mechanics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!