S Lazy-H
  • Home
  • About
  • Posts
  • Contact
  • Slide Rules
  • A Biker’s Tale

On this page

  • Identity matrix
  • Transpose matrix
  • Hermitian transpose
  • Inverse matrix

Quantum Investigations Part 5

quantum mechanics
linear algebra
Author

Sam Hutchins

Published

October 12, 2023

In this post, you may find some duplication with the first post. I am attempting to redefine what I know. Hopefully, it will all make sense and not be too convoluted.

I also find I am a bit vague on some of the computations and conversions involved with matrices, such as identity, transpose, Hermitian conjugate and inverse operations.

Identity matrix

Firstly, the identity matrix is a square matrix with 1s along the diagonal and 0s everywhere else. Suppose we have a 2x2 matrix defined A=[28−74] and a 2x2 identity matrix I=[1001]. Does it satisfy the requirement AI=IA=A?

[28−74]×[1001]=[28−74]

We can create the identity matrix in R using diag(x) where x=2 is the matrix size.

Transpose matrix

Next we look at transposing a matrix, which is exchanging the rows and columns. For this, we can use the t() function from the base R package.

A <- matrix(c(1,2,3,4,5,6,7,8,9),3,3,byrow=TRUE)

A=[123456789],AT=[147258369]

Pretty simple for that function, and the first step in the Hermitian transpose.

Hermitian transpose

Next, we look at Hermitian transpose (or conjugate transpose). For this, we can use the QZ library. So we define a complex matrix,

A <- matrix(c(1 +0i, -2 -3i, 5 +0i, 1 +2i, 0 +0i, 4 -2i),2,3,byrow=T)

and take the Hermitian transpose, H(A), which is firstly transposing the matrix, then conjugating each entry. A=[1−2−3i51+2ii4−2i],AT=[11+2i−2−3ii54−2i],A†=[11−2i−2+3ii54+2i]

Notice only the complex numbers are changed and the real numbers remain the same. For quantum mechanics, the A† (dagger) symbol is used instead of AH, perhaps so as not to be confused with the Hadamard gate1. Defining a complex matrix in R is a bit cumbersome as an error is generated if all numbers are not in the same format.

Inverse matrix

Inversing a matrix allows solving for the vector x in the matrix equation Ax=b. This is accomplished by multiplying both sides by the inverse of the matrix A. The base::solve() or matlib::inv() functions perform this. An ordinary inverse is defined only for square matrices, and performs the same role in matrix algebra as the reciprocal of a number and division does in ordinary arithmetic. Suppose we have the following sequence of commands,

A <- matrix(c(3,5,-2,1),2,2,byrow=TRUE); inv(A); inv(inv(A))

A=[35−21],A−1=[0.0769−0.38460.15380.2308],AA−1=[35−21]

Shown is the matrix, inverse and double inverse matrices. As can be seen, double inverses return the matrix to the original values. Not sure if the last is the correct syntax.

Anyway, I’m not sure where I will proceed next in this series. So, have a great day and may the Lord Jesus Bless you and yours.


Footnotes

  1. The Hadamard gate is used to perform the superposition of each initialized quantum state↩︎

© S Lazy-H 2019 - 2025