(* instalar el paquete QuantumFramework *)
PacletInstall["Wolfram/QuantumFramework"]
Needs["Wolfram`QuantumFramework`"]
qBloch[q_] := QuantumState[q]["BlochPlot"]
qNormalized[q_] := q / Norm[q]
qMeasure[q_] := (#^2 &) /@ Norm /@ q
ket0 = {1,0}
ket1 = {0,1}
(* compuertas de Pauli *)
X = {{0, 1}, {1, 0}}; Y = {{0, -I}, {I, 0}}; Z = {{1, 0}, {0, -1}};Id = {{1, 0}, {0, 1}};
(* Rotaciones *)
Rx[t_]:=MatrixExp[-I t /2 X]
Ry[t_]:=MatrixExp[-I t /2 Y]
Rz[t_]:=MatrixExp[-I t /2 Z]
(* para chequear si dos vectores corresponden al mismo estado cuántico *)
qCollinear[U_, V_] := Solve[U == coef V, coef, Complexes]
qEq[U_, V_] := Module[{solution, c},
solution = qCollinear[U, V];
If[solution == {}, {},
c = solution[[1, 1, -1]];
{re^i\[Theta] -> c, r -> Abs[c], \[Theta] -> Arg[c]}
]]