coeffs_error.append([])

    for sd in range(nsds):

        coeffs[state].append([])
        coeffs_avg[state].append([])
        coeffs_error[state].append([])

        for step in range(nsteps):
            if len(ci_coeffs[step][state]) < nsds and sd > len(
                    ci_coeffs[step][state]) - 1:
                coeffs[state][sd].append(0.0)
            else:
                coeffs[state][sd].append(ci_coeffs[step][state][sd])

        mb_coeff_avg, mb_coeff_std = data_stat.scalar_stat(coeffs[state][sd])
        coeffs_avg[state][sd].append(mb_coeff_avg)
        coeffs_error[state][sd].append(1.96 * mb_coeff_std / math.sqrt(nsteps))

        if sd == 0:
            print("std = ", mb_coeff_std)

        if sd == 0:
            plt.plot(state + 1,
                     mb_coeff_avg,
                     color="black",
                     marker='s',
                     markerfacecolor='green',
                     markeredgewidth=0.4,
                     markersize=5)
            plt.errorbar(state + 1,
Example #2
0
                        print ("beta = ", beta)
                        print ("tau  = ", tau, "fs")
 
                except:
                    pass              


        niconds = len(taus[decoherence_option_count][basis_option_count])
        print("final ", decoherence_options_names[decoherence_option_count], basis_options[basis_option_count], "niconds", niconds)

        # Sometimes, we do not have any population decay, or any successful fits. in this case, just explain this
        if len( taus[decoherence_option_count][basis_option_count] ) < 1:
            print("No taus or betas were found for ", decoherence_options[decoherence_option_count], basis_options[basis_option_count])
            pass        
        else:
            taus_avg, taus_std = data_stat.scalar_stat( taus[decoherence_option_count][basis_option_count] )       
            error_95_taus = 1.96 * taus_std / math.sqrt(niconds)

            betas_avg, betas_std = data_stat.scalar_stat( betas[decoherence_option_count][basis_option_count] )
            error_95_betas = 1.96 * betas_std / math.sqrt(niconds)
            print ("\nFinished computing data for ", decoherence_options[decoherence_option_count], [basis_option_count])
            print ("Average decay lifetime over every NAD run: ",             taus_avg, " fs")
            print ("Std_dev decay lifetime over every NAD run: ",             taus_std, " fs")
            print ("Average population decay lifetime with error (95% ci): ", taus_avg, "+-", error_95_taus, " fs\n")
            print ("final taus ", decoherence_options[decoherence_option_count], basis_options[basis_option_count],  taus_avg, "+-", error_95_taus,  "fs\n") 
            print ("final betas", decoherence_options[decoherence_option_count], basis_options[basis_option_count], betas_avg, "+-", error_95_betas, "fs\n")

        basis_option_count += 1

    #sys.exit(0)