From 6a9c864d166daf2965454b213ff0bdb5db3aeede Mon Sep 17 00:00:00 2001 From: Haggai Landa Date: Sun, 26 May 2024 18:44:07 +0300 Subject: [PATCH] Added placeholders for a bit flip Lindbladian term --- src/Pauli.cc | 16 ++++++++++++++-- src/Pauli.h | 3 ++- src/lindbladian.h | 8 ++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Pauli.cc b/src/Pauli.cc index a18e390..b146150 100644 --- a/src/Pauli.cc +++ b/src/Pauli.cc @@ -141,6 +141,10 @@ ITensor PauliSite::op(const string &opname, const Args &args) const Op.set(ud_, ud, -1.0); Op.set(uu_, uu, +1.0); } + else if (opname == "Sx_Sx") + { + Error("Operator " + opname + " missing implementation."); + } else if (opname == "_S-S+") { Op.set(dd_, uu, 1.0); @@ -231,7 +235,7 @@ ITensor PauliSite::op(const string &opname, const Args &args) const } else { - Error("Operator " + opname + " name not recognized"); + Error("Operator " + opname + " name not recognized."); } return Op; } @@ -603,7 +607,8 @@ Cplx SpinHalfSystem::Expect(const vector & opnames, const vector & return (re); } -void SpinHalfSystem::AddSingleSpinBath(double GammaPlus, double GammaMinus, double GammaDephasing, int site) +void SpinHalfSystem::AddSingleSpinBath(double GammaPlus, double GammaMinus, double GammaDephasing, + double GammaBitFlip, int site) { if (GammaMinus) { @@ -626,6 +631,13 @@ void SpinHalfSystem::AddSingleSpinBath(double GammaPlus, double GammaMinus, doub Lindbladian += -z * 0.5, "Id", site; Lindbladian += -z * 0.5, "Id", site; } + if (GammaBitFlip) + { + Cplx z = GammaBitFlip * Cplx_i; + Lindbladian += z, "Sx_Sx", site; + Lindbladian += -z * 0.5, "Id", site; + Lindbladian += -z * 0.5, "Id", site; + } } //_____________________________________________________ diff --git a/src/Pauli.h b/src/Pauli.h index baafd82..84bcd7d 100644 --- a/src/Pauli.h +++ b/src/Pauli.h @@ -62,7 +62,8 @@ class SpinHalfSystem { AutoMPO Lindbladian; //Adds a single-spin term to the Lindbladian above - void AddSingleSpinBath(double GammaPlus, double GammaMinus, double GammaDephasing, int site); + void AddSingleSpinBath(double GammaPlus, double GammaMinus, double GammaDephasing, + double GammaBitFlip, int site); //Trace of rho complex trace_rho() const; diff --git a/src/lindbladian.h b/src/lindbladian.h index 50ecdb7..165245e 100644 --- a/src/lindbladian.h +++ b/src/lindbladian.h @@ -164,13 +164,17 @@ bool SetLindbladian(SpinHalfSystem &C, ModelParameters param, Lattice2d L) if (g_2_len == 1) g_2 = vector(N, g_2[0]); + g_3 = vector(N, 0.); + // TODO: support parameter input + for (int i = 1; i <= int(N); i++) - if (g_0[i - 1] || g_1[i - 1] || g_2[i - 1]) + if (g_0[i - 1] || g_1[i - 1] || g_2[i - 1] || g_3[i - 1]) { - C.AddSingleSpinBath(g_0[i - 1], g_1[i - 1], g_2[i - 1], i); + C.AddSingleSpinBath(g_0[i - 1], g_1[i - 1], g_2[i - 1], g_3[i - 1], i); // The first argument is the rate of dissipative processes where a spin goes from down to up // The second argument is the rate of dissipative processes where a spin goes from up to down // The third argument is the rate of energy-conserving (pure) dephasing processes + // The fourth argument is the rate of bit flip processes b_time_evolution = true; } return b_time_evolution;