import numpy as np
from qiskit.opflow import X, Z, I

a_1 = np.random.random_sample()
a_2 = np.random.random_sample()
J_21 = np.random.random_sample()

transverse_ising_2_qubits = a_1*(I^X) + a_2*(X^I) + J_21*(Z^Z)

print("========== Transverse Ising Model Hamiltonian for Two Qubits ==========\n")
print(transverse_ising_2_qubits)
print()
print(transverse_ising_2_qubits.to_matrix())
print()

