# Chapter 2 - Math Tools II (Linear Operators)

At the end of the last chapter, we showed that the state of a quantum system can be represented with a complex unit vector. Seeing as how a quantum computer is a machine that manipulates the quantum states of its qubits, we need to characterize how the state vector can evolve. Under the framework of quantum mechanics, _Linear Operators_ are used to describe the time evolution and measurement of quantum systems.

In this chapter, we will describe what linear operators are and show how they relate to matrices. <a href="https://www.numpy.org">Numpy</a> will also be used for Python implementations.

## 2.1 Linear Operators
Operators are functions that map vectors to vectors. 
$$ A : V \rightarrow W,\quad\text{ where V and W are vector spaces.}$$
If the operator $A$ maps the vector $|v\rangle$ to $|w\rangle$, then we write it as
$$ A|v\rangle = |w\rangle.$$

A linear operator is an operator that satisfies the conditions of lineararity, i.e.
1. $$A \left(|v\rangle + |w\rangle\right) = \left(A|v\rangle\right) + \left(A|w\rangle\right)$$
2. $$A \left(c|v\rangle\right) = c \left(A|v\rangle\right)$$

Since every vector $|v\rangle\in V$ can be written as a linear combination of a set of basis vectors,
$$ |v\rangle = \sum_{j} \alpha_j |v_j\rangle,$$
knowing which vectors each basis vector is mapped to under the action of a linear operator allows us to calculate which vector any input vector is mapped to:
$$ A|v\rangle = A \left(\sum_{j} \alpha_j |v_j\rangle\right) = \sum_j \alpha_j A|v_j\rangle. $$


```python
#Importing necessary modules: numpy can be used to describe matrices in two ways: np.array and np.matrix
#Both were used in Chapter 1, but from now on, we will carry on with np.array
#We'll also import a sympy function so that we can visualize matrices in a clearer way. This does not affect any calculation

import numpy as np
from sympy import Matrix, init_printing

#This function uses SymPy to convert a numpy array into a clear matrix image

def view(mat):
    display(Matrix(mat))
```


```python
#Importing necessary modules: numpy can be used to describe matrices in two ways: np.array and np.matrix
#Both were used in Chapter 1, but from now on, we will carry on with np.array
#We'll also import a sympy function so that we can visualize matrices in a clearer way. This does not affect any calculation

import numpy as np
from sympy import Matrix, init_printing

#This function uses SymPy to convert a numpy array into a clear matrix image

def view(mat):
    display(Matrix(mat))#Defining a matrix in numpy, as an array

A = np.array([[1,2,3],[4,5,6],[7,8,9]])

print('Matrix A:')
print(A)

#Multiplying two matrices:

B = np.array([[3,2,1],[6,5,4],[9,8,7]])

print('AB: ')

#Printing it

print(A@B)

print('BA:')

#Viewing it... Looks better

view(B@A)

```

    Matrix A:
    [[1 2 3]
     [4 5 6]
     [7 8 9]]
    AB: 
    [[ 42  36  30]
     [ 96  81  66]
     [150 126 102]]
    BA:



$\displaystyle \left[\begin{matrix}18 & 24 & 30\\54 & 69 & 84\\90 & 114 & 138\end{matrix}\right]$



```python
#Let's say we have a vector |u> ε R^3, where |u> = (5,2,1). Let's say we have a vector |v> = 3|u> + (2,2,2)
#In other words, every component of |u>, u_i, is now mapped to 3u_i + 2
import numpy as np

u = np.array([5,2,1])
v = 3*u+2

v

#How do we generally represent this operation, though? 
```




    array([17,  8,  5])



## 2.2 Representing Linear Operators with Matrices

A matrix is a two-dimensional array of numbers, and in chapter 1 we saw how to represent vectors as either column or row matrices — matrices with exactly one column or row respectively. A matrix can also be used to numerically represent a linear operator.

Let $V$ be an $n$-dimensional vector space with a basis set $\left\{|v_k\rangle : 1\leq k \leq n \right\}$, $W$ be an $m$-dimensional vector space with a basis set $\left\{|w_j\rangle : 1\leq j \leq m \right\}$ and $A : V \rightarrow W$ be a linear operator such that
$$ A|v_k\rangle = \sum_{j=1}^m a_{jk} |w_j\rangle. $$

Then an $m\times n$ matrix (a matrix with $m$ rows and $n$ columns) can be used to represent $A$:
$$ A \equiv \begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{pmatrix} $$

The columns of this matrix are the column vectors $A|v_k\rangle$.

From here onwards, we will assume that our matrix representations use orthonormal basis sets, and for any operator $A: V\rightarrow V$, we use the same basis set for input and output bases.

### 2.2.1 Matrix-Vector Multiplication
A matrix is a numerical representation of an operator, and matrix-vector multiplication is a numerical
method to calculate the action of an operator on a vector.

First, use the same basis of $V$ to represent $|v\rangle$ as a column matrix: 
$$|v\rangle = \sum_{k=1}^n \alpha_k |v_k\rangle \equiv \begin{pmatrix} \alpha_1 \\ \alpha_2 \\ \vdots \\ \alpha_n \end{pmatrix}.$$ 

Now since $A|v\rangle = \sum_{k=1}^n \alpha_k |v_k\rangle$, we can calculate the outcome of applying the operator:

$$
\begin{align}
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{pmatrix}
\begin{pmatrix} \alpha_1 \\ \alpha_2 \\ \vdots \\ \alpha_n \end{pmatrix}
&=
\alpha_1 \begin{pmatrix} a_{11} \\ a_{21} \\ \vdots \\ a_{m1} \end{pmatrix} + 
\alpha_2 \begin{pmatrix} a_{12} \\ a_{22} \\ \vdots \\ a_{m2} \end{pmatrix} + 
\cdots + 
\alpha_n \begin{pmatrix} a_{1n} \\ a_{2n} \\ \vdots \\ a_{mn} \end{pmatrix} \\
&= 
\begin{pmatrix} 
\sum_{k=1}^n \alpha_k a_{1k} \\ 
\sum_{k=1}^n \alpha_k a_{2k} \\ 
\vdots \\ 
\sum_{k=1}^n \alpha_k a_{mk} 
\end{pmatrix}
\end{align}
$$

### 2.2.2 Composition of Operators and Matrix-Matrix Multiplication
Let $A: V\rightarrow W$ and $B: W \rightarrow X$ be linear operators acting on the vector spaces $V, W$ and $X$. The linear operator $BA : V \rightarrow X$ is defined as the composition of $A$ and $B$:
$$ BA|v\rangle = B(A |v\rangle)$$

Since this composition is also a linear operator, it can also be numerically represented with a matrix. Given basis sets $\{|v_i\rangle\}, \{|w_j\rangle\}$ and $\{|x_k\rangle\}$ for $V,W$ and $X$ respectively, and the matrices $A$ and $B$ written according to those basis sets:

$$
A = 
\begin{pmatrix}
| & | &  & | \\
A|v_1\rangle & A|v_2\rangle & \cdots & A|v_n\rangle \\
| & | &  & | \end{pmatrix}
=
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}
$$

$$
B = 
\begin{pmatrix}
| & | &  & | \\
B|w_1\rangle & B|w_2\rangle & \cdots & B|w_m\rangle \\
| & | &  & | \end{pmatrix}
=
\begin{pmatrix}
b_{11} & b_{12} & \cdots & b_{1m} \\
b_{21} & b_{22} & \cdots & b_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
b_{o1} & b_{o2} & \cdots & b_{om} \end{pmatrix}
$$
$$
\begin{align}
BA &=
\begin{pmatrix}
| & | &  & | \\
BA|v_1\rangle & BA|v_2\rangle & \cdots & BA|v_n\rangle \\
| & | &  & | \end{pmatrix} \\
&= 
\begin{pmatrix}
b_{11} & b_{12} & \cdots & b_{1m} \\
b_{21} & b_{22} & \cdots & b_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
b_{o1} & b_{o2} & \cdots & b_{om} \end{pmatrix}
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix} \\
&=
\begin{pmatrix}
c_{11} & c_{12} & \cdots & c_{1n} \\
c_{21} & c_{22} & \cdots & c_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
c_{o1} & c_{o2} & \cdots & c_{on}
\end{pmatrix}, \quad\text{where } c_{ij} = \sum_{k=1}^m b_{ik} a_{kj}
\end{align} 
$$


```python
#Defining a matrix in numpy, as an array

A = np.array([[1,2,3],[4,5,6],[7,8,9]])

print('Matrix A:')
print(A)

#Multiplying two matrices:

B = np.array([[3,2,1],[6,5,4],[9,8,7]])

print('AB: ')

#Printing it

print(A@B)

print('BA:')

#Viewing it... Looks better. Doesn't affect any calculation

view(B@A)


```

    Matrix A:
    [[1 2 3]
     [4 5 6]
     [7 8 9]]
    AB: 
    [[ 42  36  30]
     [ 96  81  66]
     [150 126 102]]
    BA:



$\displaystyle \left[\begin{matrix}18 & 24 & 30\\54 & 69 & 84\\90 & 114 & 138\end{matrix}\right]$



```python
#Representing a Linear Operator as Matrices

#Application to Quantum Computing

#X|0> = |1>, where, according to section 1.10, |0> = (1,0) and |1> = (0,1)

zero = np.array([1,0])
one = np.array([0,1])

X = np.array([[0,1],[1,0]])
print('X = ')
view(X)

print('')

#Checking to see if X|0>
XZero = X@zero
print('Is X|0> = |1>:')
#Prints true if all elements in both matrices are equal
print(XZero.all() == one.all())

print('')

print('X is a very important operator in quantum computing because it essentially acts as a quantum NOT gate. The implication of this tranformation is taking a qubit which is always 0 and making it always 1 and vice versa (X|1>=|0>).')
```

    X = 



$\displaystyle \left[\begin{matrix}0 & 1\\1 & 0\end{matrix}\right]$


    
    Is X|0> = |1>:
    True
    
    X is a very important operator in quantum computing because it essentially acts as a quantum NOT gate. The implication of this tranformation is taking a qubit which is always 0 and making it always 1 and vice versa (X|1>=|0>).


## 2.3 Adjoint / Hermitian Conjugate
Let $A : V\rightarrow V$ be a linear operator, then there exists a linear operator $A^\dagger : V \rightarrow V$ defined such that for any vectors $|v\rangle, |w\rangle \in V$ the inner product
$$ (|v\rangle, A|w\rangle) = (A^\dagger|v\rangle, |w\rangle)$$

$A^\dagger$ is called the _adjoint_ or _Hermitian conjugate_ of $A$.

Although it may not seem obvious, given a matrix representation of $A$, we can compute the matrix representation of $A^\dagger$ in the same basis by taking the transpose of $A$ and replacing every element with its complex conjugate:

$$
A \equiv \begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{pmatrix}
\implies
A^\dagger \equiv \begin{pmatrix}
a_{11}^* & a_{21}^* & \cdots & a_{n1}^* \\
a_{12}^* & a_{22}^* & \cdots & a_{n2}^* \\
\vdots & \vdots & \ddots & \vdots \\
a_{1n}^* & a_{2n}^* & \cdots & a_{nn}^*
\end{pmatrix}
$$


```python
# Calculating the adjoint of a matrix
A = np.array([ [0+1j, 1+2j], [3+0j, 0-1j] ])
print('A = ')
view(A)

def adjoint(A):
    return A.conj().transpose()

A_dagger = adjoint(A)
print('Adjoint of A = ')
view(A_dagger)
```

    A = 



$\displaystyle \left[\begin{matrix}1.0 i & 1.0 + 2.0 i\\3.0 & - 1.0 i\end{matrix}\right]$


    Adjoint of A = 



$\displaystyle \left[\begin{matrix}- 1.0 i & 3.0\\1.0 - 2.0 i & 1.0 i\end{matrix}\right]$


## 2.4 Eigenvectors and Eigenvalues
For linear operators that map to the same vector space, $A: V\rightarrow V$, a vector $|v\rangle\neq \mathbf{0}$ that is 
mapped to a scaled version of itself
$$ A|v\rangle = \lambda|v\rangle$$
is called an _eigenvector_ of $A$, and the scale factor $\lambda$ is called the _eigenvalue_ of $|v\rangle$.

For example, the matrix 
$$ X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
has eigenvectors $|+\rangle = \frac{1}{\sqrt2} \binom{1}{1}$ and $|-\rangle = \frac{1}{\sqrt2}\binom{1}{-1}$ with eigenvalues +1 and -1 respectively.

The set of all eigenvectors of an operator, sharing the same eigenvalue $\lambda$, forms a vector space which is a subspace of $V$, we call this the $\lambda$-eigenspace of the operator.

### 2.4.1 Normal Operators
If a set of eigenvectors forms a basis of $V$, we call it an eigenbasis. In the context of quantum computing, we will only consider operators that have at least one orthonormal eigenbasis that spans $V$. We call these operators _Normal operators_. A normal operator $N$ can be written in the form
$$ N = \sum_{k} \lambda_k |v_k\rangle \langle v_k| $$
where $\{|v_k\rangle\}$ forms an orthonormal eigenbasis of $V$, and $\lambda_k$ is the eigenvalue of $|v_k\rangle$. This is called the _spectral decomposition_ of $N$.

The spectral decomposition of $X$ is
$$ X = (+1)|+\rangle \langle +| + (-1)|-\rangle \langle -| $$

### 2.4.2 Trace
The trace of an operator is the sum of all of its eigenvalues. It can be calculated by adding all of the diagonal elements of any matrix representation of the operator.

### 2.4.3 Determinant
The determinant of an operator is the product of all of its eigenvalues. [Click here](https://en.wikipedia.org/wiki/Determinant) to see how to numerically calculate the determinant of a matrix representation of an operator.

Given this definition, you may now understand why solving for $\lambda$ in the equation
$$ \det(A - \lambda I) = 0$$
allows us to calculate the eigenvalues of a matrix.


```python
# Verifying the eigenvalues of X
X = np.array([ [0, 1], [1, 0] ])
print('X = ')
view(X)

eigenvalues = np.linalg.eigvals(X)
print(f'X has {len(eigenvalues)} eigenvalues:', eigenvalues)

# Verifying the spectral decomposition of X

# The eigenvectors
plus  = np.array([ [np.sqrt(0.5)], [np.sqrt(0.5)] ])
minus = np.array([ [np.sqrt(0.5)], [-np.sqrt(0.5)] ])

# |+><+|
plus_plus = plus @ adjoint(plus)
print('|+><+| = ')
view(plus_plus)
# |-><-|
minus_minus = minus @ adjoint(minus)
print('|-><-| = ')
view(minus_minus)

# the spectral decomposition
sd = plus_plus - minus_minus
print('|+><+| - |-><-| = ')
view(sd)
```

    X = 



$\displaystyle \left[\begin{matrix}0 & 1\\1 & 0\end{matrix}\right]$


    X has 2 eigenvalues: [ 1. -1.]
    |+><+| = 



$\displaystyle \left[\begin{matrix}0.5 & 0.5\\0.5 & 0.5\end{matrix}\right]$


    |-><-| = 



$\displaystyle \left[\begin{matrix}0.5 & -0.5\\-0.5 & 0.5\end{matrix}\right]$


    |+><+| - |-><-| = 



$\displaystyle \left[\begin{matrix}0.0 & 1.0\\1.0 & 0.0\end{matrix}\right]$


## 2.5 Types of Linear Operators
The following classifications of linear operators will be used all the time in quantum computing:
### 2.5.1 Identity Operator
The identity operator maps all vectors onto themselves.
$$ I |v\rangle = |v\rangle, \forall |v\rangle \in V $$
The matrix representation of the identity operator is a square matrix with 1s in all of the diagonal elements and 0s everywhere else in any choice of basis. So in a 2-dimensional space,
$$ I_2 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}. $$

Every vector in $V$ is an eigenvector of the identity, with eigenvalue 1.
### Unitary Operators
A unitary operator $U$ is one whose adjoint is its own inverse:
$$ U U^\dagger = I = U^\dagger U. $$

The eigenvalues of a unitary operator all have length 1 (hence the name unitary).

The columns of a unitary matrix are all mutually orthogonal to eachother, i.e. a unitary operator maps orthogonal bases to orthogonal bases.

Unitary operators preserve inner products, i.e
$$ (|v\rangle, |w\rangle) = (U|v\rangle, U|w\rangle) $$
This can be easily shown using bra-ket notation:
$$ \begin{align}
(U|v\rangle, U|w\rangle) &= (U|v\rangle)^\dagger U|w\rangle \\
&= \langle v | U^\dagger U |w\rangle \\
&= \langle v | I |w\rangle \\
&= \langle v|w \rangle \\
&= (|v\rangle, |w\rangle)
\end{align} $$

Unitary operators are used to describe the time evolution of quantum systems.
### Hermitian Operators
A Hermitian operator $H$ is one that is equal to its adjoint:
$$ H = H^\dagger. $$

The eigenvalues of a Hermitian operator are all real numbers, moreover the matrix representation of a Hermitian operator must have real numbers on the diagonal.

Eigenvectors of a Hermitian operator with different eigenvalues are orthogonal.

Hermitian operators are used to describe measurements of quantum systems.


```python
# Unitary operators
#Defining U and U†

#U = 0.5*np.array([[1+1j, 1-1j],[1-1j, 1+1j]])
U = np.sqrt(0.5)*np.array([ [1, 1], [0+1j, 0-1j] ])
UDagger = adjoint(U)

print('U = ')
view(U)
print('U† = ')
view(UDagger)


#|v> and |psi> = U|v>
v = np.array([1,2])
w = np.array([3,4])

# <v|w>
v_w = adjoint(v)@w
# <v| UDagger U |w>
v_U_w = adjoint(v)@UDagger@U@w

#UU† (Supposed to be I_2)

print('UU† = ')
view(U@UDagger)

print('This +/- 4.2*10^(-17)i is 0, so UU† = I')


print('')

print('Is <v|w> = <v| U† U |w>?')
print('Yes' if np.abs(v_w - v_U_w) < 1e-5 else 'No')

print('\nDo the eigenvalues have unit length?')
eigvals = np.linalg.eigvals(U)
for x in eigvals:
    print('Yes' if np.abs(np.abs(x) - 1.0 < 1e-5) else 'No')
```

    U = 



$\displaystyle \left[\begin{matrix}0.707106781186548 & 0.707106781186548\\0.707106781186548 i & - 0.707106781186548 i\end{matrix}\right]$


    U† = 



$\displaystyle \left[\begin{matrix}0.707106781186548 & - 0.707106781186548 i\\0.707106781186548 & 0.707106781186548 i\end{matrix}\right]$


    UU† = 



$\displaystyle \left[\begin{matrix}1.0 & - 4.26642158858964 \cdot 10^{-17} i\\4.26642158858964 \cdot 10^{-17} i & 1.0\end{matrix}\right]$


    This +/- 4.2*10^(-17)i is 0, so UU† = I
    
    Is <v|w> = <v| U† U |w>?
    Yes
    
    Do the eigenvalues have unit length?
    Yes
    Yes



```python
# Hermitian Operator
Y = np.array([ [0, 0+1j], [0-1j, 0] ])
print('Y = ')
view(Y)
print('Y† = ')
view(adjoint(Y))

print('Are the eigenvalues real?')
for x in np.linalg.eigvals(Y):
    print('Yes' if np.abs(x.imag) < 1e-5 else 'No')
```

    Y = 



$\displaystyle \left[\begin{matrix}0 & 1.0 i\\- 1.0 i & 0\end{matrix}\right]$


    Y† = 



$\displaystyle \left[\begin{matrix}0 & 1.0 i\\- 1.0 i & 0\end{matrix}\right]$


    Are the eigenvalues real?
    Yes
    Yes


## 2.6 Tensor Product

A _tensor product_ is a way to "combine" two vector spaces into a larger vector space.
$$\otimes : V \times W \rightarrow V\otimes W$$

### 2.6.1 Kronecker Product
Within the context of quantum computing, the _Kronecker product_ is be used to numerically evaluate the tensor product of vectors and/or matrices.

For a matrix
$$ A = \begin{pmatrix} 
a_{11} & a_{12} & \cdots a_{1n} \\
a_{21} & a_{22} & \cdots a_{2n} \\
\vdots & \vdots & \ddots \vdots \\
a_{m1} & a_{m2} & \cdots a_{mn} \\
\end{pmatrix} $$
and any matrix $B$, the Kronecker product can be evaluated as 
$$
A\otimes B = \begin{pmatrix} 
a_{11} B & a_{12} B & \cdots a_{1n} B \\
a_{21} B & a_{22} B & \cdots a_{2n} B \\
\vdots & \vdots & \ddots \vdots \\
a_{m1} B & a_{m2} B & \cdots a_{mn} B \\
\end{pmatrix} $$
Where each $a_{jk} B$ is a submatrix that is just $B$ scaled by $a_{jk}$.

The outer product $|v\rangle \langle w|$ is implicitly the tensor product $|v\rangle\otimes\langle w|$,

We often drop the $\otimes$ symbol between two kets or two bras,
$$ |v\rangle\otimes|w\rangle \equiv |v\rangle|w\rangle \equiv |vw\rangle $$

### 2.6.2 Properties of the Tensor Product
* $$ (\alpha |v\rangle) \otimes |w\rangle = \alpha (|v\rangle|w\rangle) = |v\rangle \otimes (\alpha |w\rangle) $$
* $$(|v_1\rangle + |v_2\rangle)\otimes |w\rangle = \alpha|v_1\rangle|w\rangle + |v_2\rangle|w\rangle $$
* $$|v\rangle \otimes( |w_1\rangle + |w_2\rangle) = |v\rangle|w_1\rangle + |v\rangle|w_2\rangle $$



```python
v = np.array([1,2,3]).transpose()
w = np.array([4,5]).transpose()

print('v = ')
view(v)
print('w = ')
view(w)

print('Tensor product |v>⊗|w> = ')
view(np.kron(v,w))

print('Outer product |v><w| = ')
view(np.outer(v,w))

X = np.array([[0,1],[1,0]])
Z = np.array([[1,0],[0,-1]])

print('X =')
view(X)
print('Z = ')
view(Z)

print('X⊗Z = ')
view(np.kron(X,Z))

print('Z⊗X = ')
view(np.kron(Z,X))

#Excercise. Create the equivelent to np.kron() for ket vectors (i.e two column matrices)
```

    v = 



$\displaystyle \left[\begin{matrix}1\\2\\3\end{matrix}\right]$


    w = 



$\displaystyle \left[\begin{matrix}4\\5\end{matrix}\right]$


    Tensor product |v>⊗|w> = 



$\displaystyle \left[\begin{matrix}4\\5\\8\\10\\12\\15\end{matrix}\right]$


    Outer product |v><w| = 



$\displaystyle \left[\begin{matrix}4 & 5\\8 & 10\\12 & 15\end{matrix}\right]$


    X =



$\displaystyle \left[\begin{matrix}0 & 1\\1 & 0\end{matrix}\right]$


    Z = 



$\displaystyle \left[\begin{matrix}1 & 0\\0 & -1\end{matrix}\right]$


    X⊗Z = 



$\displaystyle \left[\begin{matrix}0 & 0 & 1 & 0\\0 & 0 & 0 & -1\\1 & 0 & 0 & 0\\0 & -1 & 0 & 0\end{matrix}\right]$


    Z⊗X = 



$\displaystyle \left[\begin{matrix}0 & 1 & 0 & 0\\1 & 0 & 0 & 0\\0 & 0 & 0 & -1\\0 & 0 & -1 & 0\end{matrix}\right]$


c4b28fe7181cd9b1ce8ea0cbbf1c6ecb519fc02b
ipynb
Jupyter Notebook
Pre-requisites/Chapter 2 - Math Tools II (Linear Operators).ipynb
pratjz/TEQS
a406bf993e2b2bfebd17ca3919a95a6c54812957
MIT
Pre-requisites/Chapter 2 - Math Tools II (Linear Operators).ipynb
pratjz/TEQS
a406bf993e2b2bfebd17ca3919a95a6c54812957
MIT
Pre-requisites/Chapter 2 - Math Tools II (Linear Operators).ipynb
pratjz/TEQS
a406bf993e2b2bfebd17ca3919a95a6c54812957
MIT
Qwen/Qwen-72B
1. YES
2. YES