3
$\begingroup$

I have the following code:

The first part is just defining the matrices, the error is at the end of the code.

Id = SparseArray[{{1, 0}, {0 , 1}}];
Z = SparseArray[{{1, 0}, {0, -1}}];
X = SparseArray[{{0, 1}, {1, 0}}];

(* Check Operator Z1 for qubits 1, 2, 4 and 16 *)
Z1 = SparseArray[{KroneckerProduct[Id, Id, Z, Id, Id, Id, Id, Id, Id, 
     Id, Id, Id, Id, Id, Z, Id, Z, Z]}] ;

(* Check Operator Z2 for qubits 4,7,8 and 10 *)
Z2 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Id, Id, Z, 
     Id, Z, Z, Id, Id, Z, Id, Id, Id]}] ;

(* Check Operator Z3 for qubits 10,13,14 and 16 *)
Z3 = SparseArray[{KroneckerProduct[Id, Id, Z, Id, Z, Z, Id, Id, Z, Id,
      Id, Id, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z4 for qubits 2,3,5 and 17 *)
Z4 = SparseArray[{KroneckerProduct[Id, Z, Id, Id, Id, Id, Id, Id, Id, 
     Id, Id, Id, Id, Z, Id, Z, Z, Id]}] ;

(* Check Operator Z5 for qubits 5,8,9 and 11 *)
Z5 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Id, Z, Id, 
     Z, Z, Id, Id, Z, Id, Id, Id, Id]}] ;

(* Check Operator Z6 for qubits 11,14,15 and 17 *)
Z6 = SparseArray[{KroneckerProduct[Id, Z, Id, Z, Z, Id, Id, Z, Id, Id,
      Id, Id, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z7 for qubits 1,3,6 and 18 *)
Z7 = SparseArray[{KroneckerProduct[Z, Id, Id, Id, Id, Id, Id, Id, Id, 
     Id, Id, Id, Z, Id, Id, Z, Id, Z]}] ;

(* Check Operator Z8 for qubits 6,7,9 and 12 *)
Z8 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Z, Id, Id, 
     Z, Id, Z, Z, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z9 for qubits 12,13,15 and 18 *)
Z9 = SparseArray[{KroneckerProduct[Z, Id, Id, Z, Id, Z, Z, Id, Id, Id,
      Id, Id, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator X1 for qubits 1, 2, 4 and 16 *)
X1 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Id, Id, Id,
      Id, Id, X, X, Id, X, Id, Id, X]}] ;

(* Check Operator X2 for qubits 4,7,8 and 10 *)
X2 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, X, X, Id, X, 
     Id, Id, X, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z3 for qubits 10,13,14 and 16 *)
X3 = SparseArray[{KroneckerProduct[X, Id, X, Id, Id, X, Id, Id, Id, 
     Id, Id, Id, Id, Id, Id, Id, Id, X]}] ;

(* Check Operator Z4 for qubits 2,3,5 and 17 *)
X4 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Id, Id, Id,
      Id, X, Id, Id, X, X, Id, X, Id]}] ;

(* Check Operator Z5 for qubits 5,8,9 and 11 *)
X5 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, X, Id, Id, X, X, 
     Id, X, Id, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z6 for qubits 11,14,15 and 17 *)
X6 = SparseArray[{KroneckerProduct[Id, X, Id, X, X, Id, Id, Id, Id, 
     Id, Id, Id, Id, Id, Id, Id, X, Id]}] ;

(* Check Operator Z7 for qubits 1,3,6 and 18 *)
X7 = SparseArray[{KroneckerProduct[Id, Id, Id, Id, Id, Id, Id, Id, Id,
      X, Id, Id, X, X, Id, X, Id, Id]}] ;

(* Check Operator Z8 for qubits 6,7,9 and 12 *)
X8 = SparseArray[{KroneckerProduct[Id, Id, Id, X, Id, Id, X, X, Id, X,
      Id, Id, Id, Id, Id, Id, Id, Id]}] ;

(* Check Operator Z9 for qubits 12,13,15 and 18 *)
X9 = SparseArray[{KroneckerProduct[X, X, Id, X, Id, Id, Id, Id, Id, 
     Id, Id, Id, Id, Id, Id, X, Id, Id]}] ;

H = -(Z1 + Z2 + Z3 + Z4 + Z5 + Z6 + Z7 + Z8 + Z9) - (X1 + X2 + X3 + 
     X4 + X5 + X6 + X7 + X8 + X9);

Hvectors = 
 Eigenvectors[H, 1, Method -> {"Arnoldi", "Criteria" -> "RealPart"}]

But it gives me the following responde and I don't understand why:

Eigenvectors::arm: Method -> Arnoldi can only be used for matrices of machine- or arbitrary-precision real numbers.

Could somone explain me why this error is occuring?

$\endgroup$

1 Answer 1

5
$\begingroup$

You use matrices with integer entries. But Arnoldi is an iterative method that applies a process that leads to convergence towards the solution. The notion of convergence does not make much sense for integers. So Arnoldi requires matrices with floating point entries. Simply use Id = N[Id]; Z = N[Z]; X = N[X]; to convert your initial matrices to floating point.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.