7

You can select a basis of unitary matrices with respect to which you can decompose your matrix. For example, if your matrix $A$ is $2^n\times 2^n$, then you can select the Pauli basis $$ \sigma_y,\qquad y\in\{0,1,2,3\}^n $$ You can find the decomposition very easily. Notice that if $$ A=\sum_yA_y\sigma_y $$ then calculating $$ \text{Tr}(A\sigma_x)=A_x2^n $$ ...


4

There is a mistake, we have $$\text{Tr}(\sigma_{i_1}\sigma_{j_1}\otimes\sigma_{i_2}\sigma_{j_2}\otimes\sigma_{i_3}\sigma_{j_3}) = \delta_{i_1,j_1}\delta_{i_2,j_2}\delta_{i_3,j_3}\text{Tr}(I) = 8\delta_{i_1,j_1}\delta_{i_2,j_2}\delta_{i_3,j_3}.$$ So that $\sum_{i_1,i_2,i_3}|u_{i_1,i_2,i_3}|^2=1$. The same is true for every $n$. The other equalities that we ...


3

Check Qiskit documentation Summary of Quantum Operations under Arbitrary initialization. The function initialize does what you need (function documentation here). Example: from qiskit import QuantumCircuit import math desired_vector = [1/math.sqrt(2),-1/math.sqrt(2)] qc = QuantumCircuit(1) #circuit with 1 qubit qc.initialize(desired_vector, [0]) #0 in ...


3

Note: this is not a qiskit answer. I have no idea if qiskit provides specific methods. Firstly, you can only do this if $|b\rangle$ has length 1. If not, you need to rescale it. Let me assume that the vector has $2^n$ elements (if it's not a power of 2, you can pad it with extra 0s). For simplicity, I'm going to assume that $|b\rangle$ is real. Then, what I'...


1

Beware! If $M$ is an operator describing a measurement, it is not that the output after measurement is $M|\psi\rangle$ for initial state $|\psi\rangle$. Instead, let $\{P_i\}$ be projectors onto the different eigenspaces of $M$. The you get the outcome $i$ with probability $p_i=\langle\psi|P_i|\psi\rangle$ and the state after measurement, if you get that ...


Only top voted, non community-wiki answers of a minimum length are eligible