Skip to content

Commit

Permalink
Update F2_Stochastic_Matrix_LA.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanderReascos authored Dec 16, 2024
1 parent 7a51047 commit eab1490
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/F2_Stochastic_Matrix_LA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@
"while len(b_dims[b_dims !=0]) < 2 or np.sum(b_dims) == 0 or np.sum(b_dims) != max_size:\n",
" b_dims = np.random.randint(5, size=5)\n",
"\n",
"structure = get_structure(b_dims)\n",
"mask = Block(structure)\n",
"block_mask = get_block_mask(b_dims)\n",
"mask = Block(block_mask)\n",
"\n",
"# Creating random Hamiltonian\n",
"I, J = structure.shape\n",
"H, omegas, lambdas = create_Hamiltonian(I, J, structure)\n",
"I, J = block_mask.shape\n",
"H, omegas, lambdas = create_Hamiltonian(I, J, block_mask)\n",
"values = substitution_rules(I,J, omegas, lambdas)\n",
"\n",
"Hh = np.array(H.subs(values), dtype=float) # Numerical Hamiltonian\n",
"# Obtainining initial Hamiltonian (with values) and exact bd transformation\n",
"exact_result = exact_block_diagonalization(Hh, structure)"
"exact_result = exact_block_diagonalization(Hh, block_mask)"
]
},
{
Expand Down Expand Up @@ -176,7 +176,7 @@
"source": [
"# Plotting\n",
"fig, ax = plt.subplots(figsize=(15, 5), dpi = 100)\n",
"im = ax.imshow(np.array(structure, dtype=float), cmap='inferno') # Initial Hamiltonian\n",
"im = ax.imshow(np.array(block_mask, dtype=float), cmap='inferno') # Initial Hamiltonian\n",
"cax = fig.add_axes([ax.get_position().x1+0.01,ax.get_position().y0,0.02,ax.get_position().height])\n",
"fig.colorbar(im, cax=cax)\n",
"#plt.savefig('LA_mask.pdf', bbox_inches='tight')"
Expand Down

0 comments on commit eab1490

Please sign in to comment.