Example #1
0
def plot_spectrum_for_FM_range(MminL,
                               MmaxL,
                               edge_states,
                               N,
                               ham_labels,
                               interaction_strength,
                               confining_strength,
                               FM_range,
                               cutoff=None,
                               ax=None,
                               subspace_size=0):
    filenameFunc = lambda x: FM.filename_spectrum_lz_total_vals(
        MminL, MmaxL, edge_states, N, ham_labels,
        [interaction_strength, confining_strength, 0.0, x])
    if subspace_size:
        filenameFunc = lambda x: FM.filename_lz_total_spectrum_low_lying_subspace(
            MminL, MmaxL, edge_states, N, ham_labels,
            [interaction_strength, confining_strength, 0.0, x], subspace_size)

    title = 'Energy spectrum for MminL=' + str(MminL) + ' MmaxL=' + str(MmaxL) + ' edges=' + str(
        edge_states) + ' N= ' + str(N) + '\ninteraction type=' + ham_labels[0] + ' ' + str(
        interaction_strength) + '\nconfining potential=' + ham_labels[1] + ' ' + str(
        confining_strength) + '\nFM term=' + \
            ham_labels[3]
    xlabel = 'FM coupling strength'
    ylabel = 'Energy'

    plot_data_for_parameter_range(FM_range, filenameFunc, title, xlabel,
                                  ylabel, cutoff, ax)
def calc_lz_vals_for_spectrum_from_scratch(params_filename,
                                           lz_val_external=None,
                                           parameters_external=None):
    params = ParametersAnnulus(params_filename)
    if lz_val_external:
        lz_val = lz_val_external
    else:
        lz_val = params.lz_val

    if parameters_external:
        parameters = parameters_external
    else:
        parameters = params.h_parameters

    filename_lz_spectrum = FM.filename_spectrum_lz_total_vals(
        params.MminLaughlin, params.MmaxLaughlin, params.edge_states, params.N,
        params.hamiltonian_labels, parameters)
    if EC.does_file_really_exist(filename_lz_spectrum):
        print("already created " + filename_lz_spectrum)
        return filename_lz_spectrum

    filename_spectrum = calc_low_lying_spectrum_from_scratch(
        params_filename, lz_val_external, parameters_external)
    while not EC.does_file_really_exist(filename_spectrum):
        sleep(60)
    matrix_name = 'total_angular_momentum'
    matrix_label = params.total_ang_momentum_label
    args = [
        params.MminLaughlin, params.MmaxLaughlin, params.edge_states, params.N,
        lz_val, matrix_label
    ]
    AMAS.create_matrix_pieces(params.MminLaughlin, params.MmaxLaughlin,
                              params.edge_states, params.N, lz_val,
                              matrix_label, matrix_name, params_filename)

    filename_lz_matrix = FM.filename_complete_matrix(matrix_name, args)
    while not EC.does_file_really_exist(filename_lz_matrix):
        sleep(60)

    queue = params.lz_spectrum_queue
    mem, vmem = JS.get_mem_vmem_vals(queue, params.lz_spectrum_mem,
                                     params.lz_spectrum_vmem)
    args = [params_filename]
    if lz_val_external:
        args = args + [lz_val_external]
    if parameters_external:
        args = args + parameters_external
    args = args + ['spectrum_lz_calc']
    jobname = 'calc_lz_spectrum_' + '_'.join([str(a) for a in args])
    jobname = EC.make_job_name_short_again(jobname)
    JS.send_job(scriptNames.multiFile,
                pbs_filename=jobname,
                script_args=args,
                queue=queue,
                mem=mem,
                vmem=vmem)

    return filename_lz_spectrum
def calc_lz_total_for_spectrum(MminL,
                               MmaxL,
                               edge_states,
                               N,
                               lz_val,
                               hamiltonian_labels,
                               parameters,
                               params_filename,
                               run_on_cluster=1):
    filename_lz_spectrum = FM.filename_spectrum_lz_total_vals(
        MminL, MmaxL, edge_states, N, hamiltonian_labels, parameters)
    if EC.does_file_really_exist(filename_lz_spectrum):
        print("already created " + filename_lz_spectrum)
        return 0

    if lz_val != 'not_fixed':
        lz_val = int(float(lz_val))
    filename_spectrum = FM.filename_spectrum_eigenstates(
        MminL, MmaxL, edge_states, N, lz_val, hamiltonian_labels, parameters)
    if EC.does_file_really_exist(filename_spectrum):
        spectrum_eigenstates = FM.read_spectrum_eigenstates(
            MminL, MmaxL, edge_states, N, lz_val, hamiltonian_labels,
            parameters)
    else:
        if run_on_cluster:
            print("spectrum should have been written by now")
            return 0
        spectrum_eigenstates = get_low_lying_spectrum(
            MminL, MmaxL, edge_states, N, lz_val, hamiltonian_labels,
            parameters, params_filename, run_on_cluster)

    spectrum = np.array([a[0] for a in spectrum_eigenstates])
    lz_total_spectrum_vals = np.zeros(len(spectrum_eigenstates))
    lz_total_matrix = extract_complete_matrix(MminL, MmaxL, edge_states, N,
                                              lz_val, 'None',
                                              'total_angular_momentum',
                                              run_on_cluster)
    for i in range(len(spectrum_eigenstates)):
        state = spectrum_eigenstates[i][1]
        lz_total_spectrum_vals[i] = np.conjugate(
            state).transpose() @ lz_total_matrix @ state

    xlabel = 'Lz total'
    ylabel = 'Energy'
    title = 'low spectrum of system with\nN=' + str(N) + ' MminL=' + str(
        MminL) + ' MmaxL=' + str(MmaxL) + ' edge_states=' + str(
            edge_states
        ) + '\npotential_type=' + hamiltonian_labels[0] + '  ' + str(
            parameters[0]
        ) + '\nconfining potential=' + hamiltonian_labels[1] + '  ' + str(
            parameters[1]) + '\nFM_term=' + hamiltonian_labels[3] + "  " + str(
                parameters[3])
    graphData.write_graph_data_to_file(filename_lz_spectrum,
                                       lz_total_spectrum_vals, spectrum, title,
                                       None, xlabel, ylabel)

    return lz_total_spectrum_vals, spectrum
Example #4
0
def plot_energy_vs_lz_toggle(MminL,
                             MmaxL,
                             edge_states,
                             N,
                             ham_labels,
                             interaction_strength,
                             confining_strength,
                             FM_range,
                             cutoff=None,
                             subspace_size=0):
    filenameFunc = lambda x: FM.filename_spectrum_lz_total_vals(
        MminL, MmaxL, edge_states, N, ham_labels,
        [interaction_strength, confining_strength, 0.0, x])
    if subspace_size:
        filenameFunc = lambda x: FM.filename_lz_total_spectrum_low_lying_subspace(
            MminL, MmaxL, edge_states, N, ham_labels,
            [interaction_strength, confining_strength, 0.0, x], subspace_size)
    plot_data_vs_parameter_toggle(FM_range, filenameFunc, cutoff)
def calc_lz_spectrum_wrap_job(params_filename,
                              lz_val_external=None,
                              parameters_external=None,
                              magnetic_flux_index=0):
    params = ParametersAnnulus(params_filename)
    if lz_val_external:
        lz_val = lz_val_external
    else:
        lz_val = params.lz_val

    if parameters_external:
        parameters = parameters_external
    else:
        parameters = params.h_parameters

    if params.is_magnetic_flux:
        params.setHamiltonianLabels(magnetic_flux_index)
    filename_lz_spectrum = FM.filename_spectrum_lz_total_vals(
        params.MminLaughlin, params.MmaxLaughlin, params.edge_states, params.N,
        params.hamiltonian_labels, parameters)
    if EC.does_file_really_exist(filename_lz_spectrum):
        print("already created " + filename_lz_spectrum)
        return 0
    queue = params.lz_spectrum_manager_queue
    mem, vmem = JS.get_mem_vmem_vals(queue, params.lz_spectrum_manager_mem,
                                     params.lz_spectrum_manager_vmem)
    args = [params_filename]
    if lz_val_external:
        args = args + [lz_val_external]
    if parameters_external:
        args = args + parameters_external
    args = args + ['spectrum_lz_vals_manager']
    jobname = 'lz_spectrum_manager_params_file' + params.params_filename_no_path
    jobname = EC.make_job_name_short_again(jobname)
    JS.send_job(scriptNames.multiFile,
                pbs_filename=jobname,
                script_args=args,
                queue=queue,
                mem=mem,
                vmem=vmem)
    return 0