def test_grid_get_spin_matrix(): system_data = systemdata.SystemData(spin_data_small_path()) current_grid = grid.Grid(system_data) assert current_grid.get_spin_matrix() == system_data.spins
def test_connection_data_dimension_column(): system_data = systemdata.SystemData(spin_data_small_path()) assert len(system_data.connections[0]) == 16
def test_spin_data_dimension_row(): system_data = systemdata.SystemData(spin_data_small_path()) assert len(system_data.spins) == 4
def test_connection_data_first_entry(): system_data = systemdata.SystemData(spin_data_small_path()) assert system_data.connections[0][0] == 2
def test_spin_data_first_entry(): system_data = systemdata.SystemData(spin_data_small_path()) assert system_data.spins[0][0] == -1
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import argparse import sys sys.path.append('../src') import systemdata parser = argparse.ArgumentParser() parser.add_argument('filename') args = parser.parse_args() system_data = systemdata.SystemData(args.filename) spin_matrix = system_data.spins fig, ax = plt.subplots() i = ax.imshow(spin_matrix, cmap=cm.Greys, interpolation='nearest') plt.show()