コード例 #1
0
ファイル: Chain.cpp プロジェクト: lise1020/TBMTJ
double Chain::unname_y(const double o1, const double o2, const double E)
{
    cx_mat G_ls = this->G_L(o1, o2, E);
    cx_mat22 G_bP = zeros<cx_mat>(2,2);  // bar-lead
    cx_mat22 G_Pb = zeros<cx_mat>(2,2);  // lead-bar


    // not check!!! lead-bar
    G_Pb(0, 0) = G_ls(13 - 1, 11 - 1);
    G_Pb(0, 1) = G_ls(13 - 1, 12 - 1);
    G_Pb(1, 0) = G_ls(14 - 1, 11 - 1);
    G_Pb(1, 1) = G_ls(14 - 1, 12 - 1);

    // not check!!! bar-lead
    G_bP(0, 0) = G_ls(11 - 1, 13 - 1);
    G_bP(0, 1) = G_ls(11 - 1, 14 - 1);
    G_bP(1, 0) = G_ls(12 - 1, 13 - 1);
    G_bP(1, 1) = G_ls(12 - 1, 14 - 1);

    cx_mat22 netG = G_Pb - G_bP;
    // netG = netG*np.mat([[0,1],[1,0]]) # pauli x
    netG = netG * cx_mat22({0, -cx_double(0,1), cx_double(0,1), 0});  // pauli y
    cx_double trace_netG = netG(0, 0) + netG(1, 1);


    return (trace_netG).real();
}
コード例 #2
0
//------------------------------------------------------------------------------
ComplexTimeRungeKuttaFehlberg::ComplexTimeRungeKuttaFehlberg(Config *cfg):
    ComplexTimePropagation(cfg)
{
    try{
        epsilon = cfg->lookup("ComplexTimeIntegration.rungeKuttaFehlberg.epsilon");
    } catch (const SettingNotFoundException &nfex) {
        cerr << "ComplexTimeRungeKuttaFehlberg::ComplexTimeRungeKuttaFehlberg(Congif *cfg)"
             << "::Error reading parameter from config object." << endl;
        exit(EXIT_FAILURE);
    }
    i = cx_double(1,0);
}
コード例 #3
0
ファイル: Chain.cpp プロジェクト: lise1020/TBMTJ
std::vector<double> Chain::unname2(const double o1, const double o2, const double E)
{
    cx_mat G_ls = this->G_L(o1, o2, E);
    cx_mat22 G_bP = zeros<cx_mat>(2,2);  // bar-lead
    cx_mat22 G_Pb = zeros<cx_mat>(2,2);  // lead-bar


    // not check!!! lead-bar
    G_Pb(0, 0) = G_ls(13 - 1, 11 - 1);
    G_Pb(0, 1) = G_ls(13 - 1, 12 - 1);
    G_Pb(1, 0) = G_ls(14 - 1, 11 - 1);
    G_Pb(1, 1) = G_ls(14 - 1, 12 - 1);

    // not check!!! bar-lead
    G_bP(0, 0) = G_ls(11 - 1, 13 - 1);
    G_bP(0, 1) = G_ls(11 - 1, 14 - 1);
    G_bP(1, 0) = G_ls(12 - 1, 13 - 1);
    G_bP(1, 1) = G_ls(12 - 1, 14 - 1);

    cx_mat22 netG = G_Pb - G_bP;




    cx_mat22 netG_x = netG * cx_mat22({0, 1, 1, 0}); // pauli x
    cx_mat22 netG_y = netG * cx_mat22({0, -cx_double(0,1), cx_double(0,1), 0});  // pauli y
    cx_mat22 netG_z = netG * cx_mat22({1, 0, 0, -1}); // pauli z

    cx_double trace_netG_x = netG_x(0, 0) + netG_x(1, 1);
    cx_double trace_netG_y = netG_y(0, 0) + netG_y(1, 1);
    cx_double trace_netG_z = netG_z(0, 0) + netG_z(1, 1);

    std::vector<double> result(3);
    result[0] = trace_netG_x.real();
    result[1] = trace_netG_y.real();
    result[2] = trace_netG_z.real();
    return result;
}