text:
# More precise Bessel functions Python

I've got some code that uses the modified bessel functions of both 1st and 2nd order (iv and kv). Annoyingly they seem to have limits, those are iv(0,713) and kv(0,697), add one to each and you get infinity and 0 respectively. This is a problem for me because I need to use values higher than this, often up to 2000 or more. When I try to divide by these I end up diving by 0 or by infinity which means I either get errors or zeros, neither of which I want.

I'm using the scipy bessel functions, are there any better functions that can cope with much smaller and much larger numbers, or a way of modifying Python to work with these big numbers. I'm unsure what the real issue here is as to why Python can't work these out much beyond 700, is it the function or is it Python?

I don't know if Python is already doing it but I'd only need the first 5-10 digits *10^x for example; that is to say I wouldn't need all 1000 digits, perhaps this is the problem with how Python is working it out compared to how Wolfram Alpha is working it out?

-
I don't think its a python problem so much as a double floating point range issue. scipy is providing a wrapper around C code which is actually implementing the bessel function. As such, its limited to the range a double can accommodate. –  sizzzzlerz Dec 5 '12 at 15:31
yes, I just did sys.float_info and guess what? max_10_exp=308 which is more or less exactly the answer to the bessel functions at the limit. This is pretty bad news for me. How is Wolfram Alpha able to work it out though? –  Rapid Dec 5 '12 at 15:34
Magic? I don't know but I'm pretty sure Alpha gets its code base from Wolfram's Mathematica which is a pretty sophisticated tool. They've implemented some sort of algorithm that allows them to return essentially unlimited precision and range for transcendental functions like the bessel. –  sizzzzlerz Dec 5 '12 at 16:09

The iv and kv functions in Scipy are more or less as good as you can get if using double precision machine floating point. As noted in the comments above, you are working in the range where the results overflow from the floating point range.

You can use the mpmath library, which does adjustable precision (software) floating point, to get around this. (It's similar to MPFR, but in Python):

In [1]: import mpmath

In [2]: mpmath.besseli(0, 1714)
mpf('2.3156788070459683e+742')

In [3]: mpmath.besselk(0, 1714)
mpf('1.2597398974570405e-746')

-
This seems to get the correct answers so thank you very much. The only issue I've got is trying to incorporate the mpf stuff into the rest of my code. As it's not a float it's giving me a lot of errors and mpf doesn't seem to accept arrays? You've answered my question though so I'm just going to have to do a fair amount of research into mpf and mpfr etc. Is there no way to have 1.2597e-746 stroed as a float, I mean there is only 11 things to store. Hmmm. –  Rapid Dec 5 '12 at 17:12
You need to keep everything as mpf. However, a good idea can also be to work with the logarithms of small numbers rather than the logarithms themselves. If you need to add numbers, use logaddexp. Or, you can rethink the problem and do some mathematics to try to get rid of the huge and tiny numbers. –  pv. Dec 5 '12 at 21:06

mpmath is a fantastic library and is the way to go for high-precision calculations. It is worth nothing that these functions can be computed from their more basic constituents. Thus, you are not forced to abide by scipy's restriction and you can use a different high precision library. Minimal example below:

import numpy as np
from scipy.special import *

X = np.random.random(3)

v = 2.000000000

print "Bessel Function J"
print jn(v,X)

print "Modified Bessel Function, Iv"
print ((1j**(-v))*jv(v,1j*X)).real
print iv(v,X)

print "Modified Bessel Function of the second kind, Kv"
print (iv(-v,X)-iv(v,X)) * (np.pi/(2*sin(v*pi)))
print kv(v,X)

print "Modified spherical Bessel Function, in"
print np.sqrt(np.pi/(2*X))*iv(v+0.5,X)
print [sph_in(floor(v),x)[0][-1] for x in X]

print "Modified spherical Bessel Function, kn"
print np.sqrt(np.pi/(2*X))*kv(v+0.5,X)
print [sph_kn(floor(v),x)[0][-1] for x in X]

print "Modified spherical Bessel Function, in"
print np.sqrt(np.pi/(2*X))*iv(v+0.5,X)
print [sph_in(floor(v),x)[0][-1] for x in X]

This gives:

Bessel Function J
[ 0.01887098  0.00184202  0.08399226]

Modified Bessel Function, Iv
[ 0.01935808  0.00184656  0.09459852]
[ 0.01935808  0.00184656  0.09459852]

Modified Bessel Function of the second kind, Kv
[  12.61494864  135.05883902    2.40495388]
[  12.61494865  135.05883903    2.40495388]

Modified spherical Bessel Function, in
[ 0.0103056   0.00098466  0.05003335]
[0.010305631072943869, 0.00098466280846548084, 0.050033450286650107]

Modified spherical Bessel Function, kn
[   76.86738631  2622.98228411     6.99803515]
[76.867205587011171, 2622.9730878542782, 6.998023749439338]

Modified spherical Bessel Function, in
[ 0.0103056   0.00098466  0.05003335]
[0.010305631072943869, 0.00098466280846548084, 0.050033450286650107]

This will fail for the large values you are looking for unless the underlying data has high precision.

-

Could be the problem is with the function. For large positive x, there is the asymptotic kv(nu,x) ~ e^{-x}/\sqrt{x} for any nu. So for large x you end up with very small values. If you are able to work with the log of the Bessel function instead, the problems will vanish. Scilab exploits this asymptotic: its has a parameter ice which defaults to 0, but when set to 1 will return exp(x)*kv(nu,x), and this keeps everything of reasonable size.

Actually, the same is available in scipy - scipy.special.kve

-
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  SSA Jan 20 at 10:27


text:
# Union of Intersections

Jump to navigation Jump to search

## Theorem

$\paren {S_1 \cap S_2} \cup \paren {T_1 \cap T_2} \subseteq S_1 \cup T_1$

## Proof

 $\displaystyle \paren {S_1 \cap S_2} \cup \paren {T_1 \cap T_2}$ $=$ $\displaystyle \paren {\paren {S_1 \cap S_2} \cup T_1} \cap \paren {\paren {S_1 \cap S_2} \cup T_2}$ Union Distributes over Intersection $\displaystyle$ $=$ $\displaystyle \paren {S_1 \cup T_1} \cap \paren {S_2 \cup T_1} \cap \paren {\paren {S_1 \cap S_2} \cup T_2}$ Union Distributes over Intersection $\displaystyle$ $\subseteq$ $\displaystyle S_1 \cup T_1$ Intersection is Subset

$\blacksquare$

## Examples

### Example: $4$ Arbitrarily Chosen Sets of Complex Numbers

Let:

 $\displaystyle A$ $=$ $\displaystyle \set {1, i, -i}$ $\displaystyle B$ $=$ $\displaystyle \set {2, 1, -i}$ $\displaystyle C$ $=$ $\displaystyle \set {i, -1, 1 + i}$ $\displaystyle D$ $=$ $\displaystyle \set {0, -i, 1}$

Then:

$\paren {A \cap C} \cup \paren {B \cap D} = \set {1, i, -i}$

format: plain


text:
# Can this be simlified?

1. Apr 15, 2006

### Crusty

Can this be simPlified?:rofl:

A = B - sin(degtorad(C)) * sqrt(abs(sqr(D/2) - sqr(sqrt(sqr(E - F) + sqr(B - G))/2)))

A, B, C, D, E, F, G are variables. I don't need to simlify down to a numerical value of a variable just now; I'm just wondering if the equation can be simplified.

Other terms
degtorad() means the amount inside the paranthese is converted from degrees to radians.
radtodeg() converts radians to degrees.
abs() means absolute value
sqr() and sqrt() are square and square root

Thanks

Last edited: Apr 15, 2006
2. Apr 15, 2006

### HallsofIvy

Staff Emeritus
Well, there's the obvious point that
sqr(sqrt(sqrt(sqr(E - F) + sqr(B - G))/2)= (sqrt(sqr(E - F) + sqr(B - G))/4
That is, that
$$\frac{\left(\sqrt{(E-F)^2+ \sqrt{B-G}}\right)^2}{2}= \frac{\sqrt{(E-F)^2+ \sqrt{B-G}}}{4}$$

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook


text:
Comparative study of non-Markovianity measures in exactly solvable one and two qubit models

# Comparative study of non-Markovianity measures in exactly solvable one and two qubit models

Carole Addis SUPA, EPS/Physics, Heriot-Watt University, Edinburgh, EH14 4AS, UK    Bogna Bylicka Institute of Physics, Faculty of Physics, Astronomy and Informatics, Nicolaus Copernicus University, Grudziadzka 5, 87-100 Toruń, Poland    Dariusz Chruściński Institute of Physics, Faculty of Physics, Astronomy and Informatics, Nicolaus Copernicus University, Grudziadzka 5, 87-100 Toruń, Poland    Sabrina Maniscalco Turku Center for Quantum Physics, Department of Physics and Astronomy, University of Turku, FIN-20014 Turku, Finland
July 9, 2019
###### Abstract

In this paper we present a detailed critical study of several recently proposed non-Markovianity measures. We analyse their properties for single qubit and two-qubit systems in both pure-dephasing and dissipative scenarios. More specifically we investigate and compare their computability, their physical meaning, their Markovian to non-Markovian crossover, and their additivity properties with respect to the number of qubits. The bottom-up approach that we pursue is aimed at identifying similarities and differences in the behavior of non-Markovianity indicators in several paradigmatic open system models. This in turn allows us to infer the leading traits of the variegated phenomenon known as non-Markovian dynamics.

###### pacs:
03.65.Ta, 03.65.Yz, 03.75.Gg
thanks: These two authors contributed equally to this work.thanks: These two authors contributed equally to this work.

## I Introduction

The last decade has seen a renewed interest in theoretical and experimental investigations on fundamental studies of open quantum systems. The reasons for such interest are manifold. On the one hand, we have witnessed a tremendous advance in the development of quantum technologies, stemming from the ability to coherently control in a robust and efficient manner the dynamics of an ever increasing number of particles. Quantum technologies need to be scalable to reach the market, which entails understanding and minimizing environment-induced decoherence effects in order to achieve the required thresholds for error correction. On the other hand the environment itself has been proven to be experimentally controllable and modifiable. Nowadays reservoir engineering techniques are used for both minimizing the effects of environmental noise and as testbeds of theoretical models.

All recent investigations on open quantum systems dynamics highlight the existence of two different classes of dynamical behavior known as Markovian and non-Markovian regimes. Historically, in the quantum domain Markovian dynamics has been associated to the semigroup property of the dynamical map describing the system evolution. If one thinks in terms of a microscopic model of system, environment and interaction, a Markovian description of the open system requires a number of assumptions, such as system-reservoir weak coupling, and leads to a master equation in the so-called Lindblad form Lindblad (); GKS (). In certain scenarios, however, such approximations are not justified and one needs to go beyond perturbation theory. It is clear that, due to the general complexity of the problem to be studied, exact solutions exist only for simple open quantum systems models such as the well-known Jaynes-Cummings model Barry (), the quantum Brownian motion model QBM (), and certain pure dephasing models puremodel1 ()-puremodel3 (). Despite the fact that these models are often idealized versions of what can be implemented in current experiments, it is undoubtedly very important to fully understand and study these systems and compare the theoretical predictions with experimental implementations.

One of the first features that emerges from the analysis of exact models is that memory effects, usually associated to re-coherence and information backflow, are not connected to the semigroup property of the dynamical map, but are rather associated to the more general property known as divisibility, as discussed for example in Ref. quantumjumps ()-RHP (). In this spirit, a non-Markovianity measure quantifying the deviation from divisibility has been proposed in Ref. RHP (). Other measures (and corresponding definitions) are based on the behavior of quantities such as distinguishability between quantum states, as measured, e.g., by trace distance BLP (); NMPure1i () or fidelity fid (), quantum mutual information between initial and final state LFS (), channel capacities Bogna (), Fisher information fish (), and the volume of accessible physical states of a system plastina ().

What one defines as Markovian or non-Markovian dynamics is, in a sense, a question of semantics. It is tautologic to say that, in general, different definitions and corresponding measures of non-Markovianity do not coincide. We prefer to follow a more pragmatic approach. We will not insist on the concept of “the best”definition of non-Markovianity but we rather look at different measures as descriptions of different properties of the open quantum systems.

Our study will encompass the Rivas, Huelga, Pleanio (RHP) divisibility measure of RHP (), the Breuer, Laine, Piilo (BLP) distinguishability measure BLP (), the Luo, Fu, Song (LFS) coherent information measure LFS (), and the Bylicka, Chruściński, Maniscalco (BCM) channel capacity measures Bogna (). We will first consider the case of one and two qubits immersed in independent and common purely dephasing environments. We will then extend our analysis to the study of dissipative environments, again for single qubit and two qubits.

The paper is structured as follows. We begin by reviewing both the definitions and properties of the non-Markovianity measures used in the paper (Sec. II) and their properties and physical meaning (Sec. III). In Secs. IV and V we present the results of the dynamics of single qubit and two qubits interacting with pure dephasing and amplitude damping environment, respectively. Finally, Sec. VI summarises the results and presents conclusions.

## Ii Non-Markovianity measures

Let us begin by recalling basic definitions of the theory of open quantum systems. The time evolution of the density matrix, describing the state of an open quantum system, is given by a -parametrized family of completely positive and trace preserving (CPTP) maps , known as the dynamical map: , with the density matrix of the open system at the initial time . The dynamical map is divisible when it can be written as the composition of two CPTP maps , . Non-divisibility therefore occurs if there exist times at which is not CPTP.

A common feature of all non-Markovianity measures described in the following subsections is that they are based on the non-monotonic time evolution of certain quantities occurring when the divisibility property is violated. However, while non-monotonic behavior of such quantities always implies non-divisibility, the inverse is not true, i.e., there can be non-divisible maps consistent with monotonic dynamics. In this sense, if one would assume divisibility as the definition of non-Markovianity, all the other non-Markovianity measures should be considered as non-Markovianity witnesses.

### ii.1 Rivas, Huelga, Plenio Measure

With the defining attribute of all non-Markovian dynamics in mind, namely the violation of the divisibilty property, Rivas, Huelga and Plenio propose a measure based on the Choi-Jamiolkowski isomorphism Choi (). The inability to write the dynamical map as a concatenation of two independent CPTP maps connects with intuitive reasoning of present dynamics being dependent on memory effects.

For master equations written in the standard Lindblad form but with time-dependent coefficients,

 dρtdt = Ltρt=−i[H(t),ρt] (1) + ∑kγk(t)(Vk(t)ρtV†k(t)−12{V†k(t)Vk(t),ρt}),

it is possible to show that the corresponding dynamical map satisfies divisibilty if and only if . If on the other hand, becomes temporarily negative, there will exist an intermediate map which is not CPTP, defying the composition law.

According to the Choi-Jamiolkowski isomorphism Choi (), is completely positive if and only if:

 (Φt,t′⊗1l)|Ω⟩⟨Ω|≥0, (2)

where is a maximally entangled state of the open system with an ancilla. In light of this, one can quantify non-Markovianity by considering the departure of the intermediate map from a map which is completely positive RHP ():

 NRHP=∫∞0dtg(t), (3)

where

 g(t)=limϵ→0+||[1l⊗1l+(Lt⊗1l)ϵ]|Ω⟩⟨Ω|||1−1ϵ. (4)

and encapsulates the time elapsed between the initial time to the final time . The notation refers to the trace-norm.

Mathematically, an apparent advantage of this measure is that no optimization over states is required. The measure is most simple to calculate using only the specific form of the master equation. However, Eq. (4) may be also calculated in terms of the intermediate dynamical map RHP ().

We note here, in Ref. tony (), another measure based on criteria quantifying the deviation from Markovianity for quantum channels has been introduced.

### ii.2 Breuer, Laine, Piilo Measure

In Ref. BLP (), Breuer, Laine and Piilo introduce a measure based on the non-monotonicity of the trace distance in order to connect non-Markovian dynamics with a back-flow of information. The construction is based on the time evolution of the trace distance between two initial states, describing their relative distinguishability. The trace distance is contractive under CPTP maps therefore, for a divisible process, distinguishability of two initial states decreases continuously over time. Hence, the derivative of the trace distance, that can be seen as measuring the change of information content on the system, i.e. the information flux, is negative. In formulas

 σ(t,ρ1,20)=ddtD(ρ1t,ρ2t)≤0, (5)

where

 D(ρ1t,ρ2t)=12tr|ρ1t−ρ2t|, (6)

is the trace distance between two states and evolving under the influence of a certain divisible dynamical map . The authors of Ref. BLP () then define as non-Markovian a process for which, for certain time intervals, , i.e., information flows back into the system.

Following this, the measure of non-Markovianity is found by summing over all periods of non-monotonicity of the information flux, including an optimization over all pairs of initial states of the system:

 NBLP(Φt)=maxρ1,20∫σ>0dtσ(t,ρ1,20). (7)

Non-Markovian processes defined in this way are always non-divisible, however the converse is not necessarily true converse1 ()-converse3 ().

The non-additivity of this measure has been numerically proven, highlighting the challenge presented when one wishes to consider higher dimensional systems of qubits Brazil ()-elsitwoqubit (). Proofs of specific mathematical attributes of the optimal state pairs have to some degree eased the numerical challenges of this calculation by elimating regions of the -dimensional Hilbert space one should consider Optimal (). Indeed, it has been shown that the states which maximize the measure must lie on the boundary of the space of physical states and must be orthgonal. Finally, we note that in the spirit of this measure, trace distance is not a unique monotone distance and one may also use others such as the statistical distance MD ().

### ii.3 Luo, Fu, Song Measure

Luo, Fu and Song in Ref. LFS () introduce a measure of non-Markovianity based on the monotonicity property characterizing the time-evolution of correlations between system and ancilla when the dynamics are divisible. They focus on the total correlations, including both classical and quantum, captured by the quantum mutual information

 I(ρSA)=S(ρS)+S(ρA)−S(ρSA), (8)

where and are marginal states of a system and ancilla, respectively, and is von Neumann entropy of state . The definition of this measure of non-Markovianity goes as follows

 NLFS(Φ)=supρSA∫ddtI>0ddtI(ρSAt)dt, (9)

done over all possible initial states with arbitrary Hilbert space of the ancilla and . The authors insist that the optimization of the formula above is done over all possible initial states , where not only the state of the ancilla but also its Hilbert space is arbitrary. Of course this makes the optimization problem extremely complicated. Therefore the authors LFS () also propose a simpler version of this measure without optimization

 NLFS0(Φ)=∫ddtI>0ddtI(ρSAt)dt, (10)

where and is an arbitrary maximally entangled state.

Here we propose a slight simplification, a measure that is more general than Eq. (10) but simpler than Eq. (9), and still has a significant interpretation. When the initial state is pure, and also the initial state of the environment with which the system is interacting, one can rewrite as the mutual information between the input and output of the channel defining the system evolution,

 I(ρ,Φt)=S(ρ)+S(Φtρ)−S(ρ,Φt), (11)

with the von Neumann entropy of the input state, the entropy of the output state and the entropy exchange, i.e., the entropy at the output of the complementary channel . Now the non-Markovianity measure reads as

 NI(Φ)=supρ∫ddtI>0ddtI(ρ,Φt)dt. (12)

The main advantage of over the original measure is that the optimization has to be done only over the input state of the system.

### ii.4 Entanglement-Assisted Classical Capacity Measure

In Ref. Bogna () two measures that link non-Markovian dynamics with an increase in the efficiency of quantum information processing and communication are introduced. This is motivated by observing that certain capacities of quantum channels are monotonically decreasing functions of time if the channel is divisible. This behavior is a consequence of the connection between the data processing inequality dpe () and the divisibility of the dynamical map. In other words, the measures proposed in Bogna () can be treated as witnesses of non-Markovian dynamics that cause revivals of quantum channel capacities.

In that article the authors are concerned with two types of capacities. The first one is the entanglement-assisted classical capacity , which sets a bound on the amount of classical information that can be transmitted along a quantum channel when one allows Alice and Bob to share an unlimited amount of entanglement CQ (). It is defined in terms of the quantum mutual information between the input and the output of the channel, as given by Eq. (11), by optimizing over all initial states

 Cea(Φt)=supρI(ρ,Φt). (13)

Since the entanglement-assisted capacity is monotonically decreasing in time when the channel is divisible, any increase of would indicate violation of the divisibility property and so can be considered as a signature of non-Markovianity. Based on this a measure of non-Markovianity was introduced

where the integral is extended to all time intervals over which is positive.

The measure presents some advantages with respect to, e.g., . The first advantage is that the calculation requires optimization only over the input state , while the optimization required in the definition of has to be done over pairs of initial states making it much more complicated to calculate, even knowing that we can restrict ourselves to only orthogonal pairs of states (having in mind that beyond the one qubit case more than one corresponding orthogonal state may exist).

The second advantage is the additivity property. Thanks to the additivity of the mutual information one can prove the additivity of in the case of identical independent channels, i.e., .

### ii.5 Quantum Capacity Measure

The second quantity discussed in Ref. Bogna () is the quantum capacity . It gives the limit to the rate at which quantum information can be reliably sent down a quantum channel and is defined in terms of the coherent information between the input and output of the quantum channel CQ ():

 Q(Φt)=limn→∞maxρnIc(ρn,Φ⊗nt)n, (15)

with I ().

Following the same line of reasoning done for , a measure of non-Markovianity based on the non-monotonic behavior of the quantum capacity was introduced

 NQ=∫dQ(Φt)dt>0dQ(Φt)dtdt, (16)

It it worth noting that the two measures of non-Markovianity based on capacities, in general, do not coincide even for degradable channels. The distinction between them is actually quite subtle. We notice indeed that as , with the input state, we have . Therefore a measure based on the violation of the data processing inequality for certain non divisible maps and would not be able to distinguish between an increase in the different types of correlations. The optimizing state in the definitions (13) and (15), however, is time dependent and does not coincide for the two quantities, hence .

Contrarily to the entanglement-assisted classical capacity, the quantum channel capacity is in general not additive. However, for degradable channels degrad (), the general definition coincides with the one-shot capacity, , and additivity for identical independent channels holds.

## Iii Properties and interpretation of the non-Markovianity measures

In this section we review some properties and physical interpretations of the considered non-Markovianity measures.

1) Physical interpretation

Most of the non-Markovianity measures discussed here were born from an attempt to quantify and unveil the so-called reservoir memory effects. The manifestation of such memory effects, stemming from long lasting and non-negligible system-reservoir correlations, leads to a partial recovery of quantum properties previously lost due to the destructive effects of noise induced by the environment.

The BLP measure, proposed in Ref. BLP (), was arguably the first attempt in this direction. The distinguishability between pairs of states, indeed, can be seen as a way to quantify the amount of information present in a quantum system. The more we know about the system, i.e., the more information we have, the more we are able to distinguish between quantum states. The environment’s action of continuously monitoring the system gradually causes a loss of information and therefore a decrease of state distinguishability. In this description memory effects lead to information backflow, i.e. a temporary increase of distinguishability.

It is worth noting here a common abuse of this interpretation. When talking of BLP non-Markovianity many authors refer to the flow of information from the system to the environment and then back into the system or, equivalently, of a back flow of information previously lost in the environment. The BLP definition, however, is based on quantities defined on the Hilbert space of the system only and in no way takes into account the information content of the environment or how it changes due to the interaction with the system.

In order to answer to this question, and therefore to look at a connection between changes of information in the system and in the environment, we started investigating the capacity-based measures Bogna (). The entropy exchange term appearing in Eq. (11) is indeed the change in entropy of the environment, and the von Neumann entropy is one of the most common ways of quantifying the information content of a quantum state. A similar consideration holds for the LFS measure. However, while the LFS measure associates non-Markovianity to a memory-induced restoration of previously lost total (quantum + classical) correlations between an open quantum system and an ancilla, as measured by the mutual quantum information, the capacity-based measures look at a temporary increase of the entanglement assisted and quantum channel capacities. The latter ones, therefore, physically measure the total increase, due to reservoir memory, of the maximum rate at which information can be transferred in noisy channels for a fixed time interval or a fixed length of the transmission line.

The RHP measure, associated to divisibility, is often criticized for not having a clear physical interpretation and for being rather a mathematical definition than a physical one. Here we would like to conjecture, however, that a physical interpretation can be given in terms of the non-Markovian quantum jumps unravelling quantumjumps (). Whenever the system can be described in terms of a time-local master equation in Lindblad form with time-dependent coefficients, indeed, one can describe the dynamics of the open system in terms of an ensemble of state vectors whose evolution consists of non-Hermition deterministic dynamics interrupted by random quantum jumps with statistics connected to the time-dependent rates of the master equation. It is shown in Ref. quantumjumps () that when the rates become negative, i.e., the dynamical map is non-divisible and the RHP measure is non-zero, reverse quantum jumps restoring previously lost coherence occur. In this sense reverse jumps would be the physical manifestation of memory effects quantified by the RHP definition. Reverse quantum jumps always cancel or undo previously occurred jumps and therefore a jump-reverse jump pair describes a virtual process that is in principle not directly observable.

A rigorous mathematical theory linking the RHP and the BLP measures has been presented in Ref. Darek (), while a general connection between the other measures presently does not exist and, we believe, is unlikely to be found.

2) Experimental implementability

Simulation of open quantum systems in both Markovian and non-Markovian regimes is nowadays in the grasp of the experimentalists trappedions1 ()-Matteo (). It is therefore important to identify the minimum requirements for implementing experiments measuring non-Markovianity. All non-Markovianity measures here studied cannot be written in terms of system’s observables. Presently, all proposed witnesses of non-Markovianity rely on the full knowledge of the density matrix at all times WITN (). So, generally, experiments aimed at revealing one of the measures require quantum process tomography. But that is not all. The only measure that does not require an optimization procedure is the RHP measure that, however, assumes the knowledge of either the dynamical map or the explicit form of the master equation. In contrast, the BLP, LFS, and BCM measures do not in principle require an assumption on the specific model of open quantum system dynamics. However this comes with the heavy overload that the optimization should be performed experimentally. Alternatively, one may assume the validity of a given model and solve the optimization problem either numerically or analytically. In this case it is generally sufficient to know the evolution of the density matrix, so once again process tomography is generally required. From this more realistic perspective the requirement for experimental implementation of all measurements are comparable. We conclude by noticing that both the BLP and the RHP measures have been experimentally observed in optical experiments simulating pure dephasing environments puremodel1 ()-puremodel3 ().

3) Interest for quantum technologies

We conclude this section with a few remarks on the potential usefulness of non-Markovianity for quantum technologies. Recent results have shown that, in certain circumstances, the manipulation of reservoir spectral properties may lead to improvements in certain quantum technologies MNonM1 ()-MNonM6 (). First of all, it is worth noticing that the improvements demonstrated for quantum metrology MNonM1 () and for quantum key distribution MNonM2 () do hold also when the dynamical map is divisible, i.e., they are not directly connected to memory effects, as they may occur also when the dynamics is Markovian according to the measures here discussed. Other results work instead in the specific case of correlated dephasing environments, where the effect of the noise is known, such as the quantum teleportation scheme of Ref. MNonM3 (). The only general answer to the question of the connection between certain quantum technologies and non-Markovian memory effects is given in Ref. Bogna () and was in fact one of the motivations of the introduction of the channel capacity measures. Whether or not non-Markovianity can be seen as a resource for quantum technologies is still an open problem and would require rephrasing the question in terms of resource theory. We hope that such a direction will be the object of future studies.

## Iv Pure Dephasing Dynamics

We begin our analysis by looking at the dynamics of one or two qubits interacting with environments leading to pure dephasing. Note that, as there is no general monotonicity relation between the different non-Markovianity measures, it does not make sense to compare their absolute values. Therefore, in the paper we renormalize all measures to take values between zero and 1, and we look at both their qualitative behavior and the Markovian to non-Markovian crossover when certain physical parameters of the model are changed.

A microscopic model of the total system-environment dynamics is presented in Refs. puremodel1 ()-puremodel3 (). One of the advantages of this model is that it is amenable to an exact solution puremodel1 ()-puremodel3 (). We will consider initially the case of a single qubit interacting with a reservoir with spectral density of the Ohmic class. The behavior of all non-Markovianity measures in this case has been studied in Refs. RHP ()-BLP (), NMPure3 ()-NMPure4 (). We will then extend the analysis to the case of two qubits in both independent and common environments. Both BLP and RHP measures have been studied also in this case in Ref. Brazil ()-elsitwoqubit (). The analysis of the LFS and BCM measures for two qubits is the first result of our paper.

In the following subsection we will present results on the behavior of the four non-Markovianity measures here considered. A thorough comparison and discussion about these results will be given in Sec. VI.

### iv.1 Single qubit: the model

The dynamics of a purely dephasing single qubit is captured by the time-local master equation bp ():

 Ltρt=γ1(t)[σzρtσz−ρt], (17)

with the time-dependent dephasing rate and the Pauli spin operator. The decay of the off-diagonal elements of the density matrix is described by the decoherence factor , where and, for zero-temperature environments puremodel2 (),

 Γ(t) = 2∫t0dt′γ1(t′) (18) = 4∫dωJ(ω)1−cos(ωt)ω2,

with the reservoir spectral density puremodel2 (); NMPure4 ().

We consider a reservoir spectral density of the form,

 J(ω)=ωsωs−1ce−ω/ωc, (19)

where is the cutoff frequency and is the Ohmicity parameter. Further details on this model can be found in Appendix A.

In this model re-coherence occurs when temporarily decreases for certain time intervals, corresponding to a negative value of the dephasing rate . One may analytically determine the times encapsulating non-monotonic intervals of , i.e. corresponding to , with the number of such time intervals. The extremes of the time intervals, and , will depend on the Ohmicity parameter , as changing one changes the form of the reservoir spectral density. In Ref. Timediscord () it is shown that, for , at all times, or equivalently increases monotonically. For and for , i.e., we only have one time interval of non-monotonic behavior. For , , i.e., there are more than one interval of time for which the dephasing rates become negative.

We give here the analytical expressions of at times and as these will be used in the following.

 Γ(a1)=2~Γ[s][1+coss(π/s)]s−1 (20) Γ(b1)=2~Γ[s][1−coss(2π/s)]s−14

where is the Euler gamma function

### iv.2 Single qubit: the measures

RHP Measure

Inserting Eq. (17) into Eq. (4) and using Eq. (3) one immediately obtains the analytical expression for the RHP non-Markovianity measure for a single qubit RHP ():

 NRHP=−2∫γ1(t)<0dtγ1(t)=∑iΓ(ai)−Γ(bi). (23)

For the sake of simplicity we look at values of the Ohmicity parameter in the interval . In this case there is only one interval of negativity of the decay rates and the only values needed are and , defined in Eqs. (20)-(22).

In Fig. 1 we plot for different values of the Ohmicity parameter (red stars). As one can see from the analytical expression, for increasing the area of the region of negativity of the dephasing rates increases, hence the measure monotonically increases for higher and higher values of .

BLP Measure

It is straightforward to show that can be written in terms of the two independent elements of the single qubit density matrix EM ()

 NBLP=−2maxm,n∫γ1<0dtγ1(t)|n|2e−2Γ(t)√m2+|n|2e−2Γ(t), (24)

where and , with the diagonal elements of the initial density matrices of the pair and their off diagonal elements, with . This expression shows immediately that iff ; i.e. only when the dynamical map is non-divisible BLP ().

For the model here considered it is possible to analytically solve the optimization problem of Eq. (24) ana (). The pair of states optimizing the increase of the trace distance are antipodal states lying on the equatorial plane, e.g., the states , with and the two states forming the qubit. Hence, we now have:

 NBLP=∑ie−Γ(bi)−e−Γ(ai) (25)

where again indicates the time intervals when .

Figure 1 shows the behavior of when changing (blue asterix). The measure remains non-zero for increasing values of but, contrarily to the RHP measure it starts decreasing taking small but finite values for .

LFS Measure

Numerical results show that the optimizing state for this measure is the maximally mixed state Bogna (). Since , where stands for the binary Shannon entropy, one has

 ddtI(I2,Φt)=−12γ1(t)e−Γ(t)log2(1+e−Γ(t)1−e−Γ(t)), (26)

which indicates that the measure has non-zero value if and only if , i.e., whenever the dynamical map is non-divisible.

The explicit expression for the measure is then easily written as

 NI(Φt)=∑i[H2(12+e−Γ(ai)2)−H2(12+e−Γ(bi)2)]. (27)

It is worth noting that in the case of the dephasing channel here considered, for the simple measure without optimization we have, .

In Fig. 1 we plot as a function of (green circles). We note that the behavior of this measure is qualitatively similar to that of .

BCM Measures

In case of pure-dephasing channels the state optimizing the formula for the classical entanglement assisted capacity is a maximally mixed state, independently of time or of the specific properties of the environmental spectrum. This means that there is a simple analytical formula characterizing it, namely QCDegradable (). Hence the measures based on mutual information and classical entanglement assisted capacity, in this particular case, coincide: .

The dephasing channel is degradable for all admissible dephasing rates , i.e. whenever . This simplifies the calculations of the quantum capacity. Indeed, we find that the state optimizing the coherent information in the definition of the quantum capacity is once again the maximally mixed state. Having this in mind one can show a very simple relation between the two capacities, namely . It follows immediately that .

We conclude this subsection stressing that, for the single qubit case, all non-Markovianity measures detect non-divisibility, hence when studying their behavior as a function of the parameter we obtain the same crossover between Markovian and non-Markovian dynamics, i.e., . A direct comparison between the analytic expressions of Eqs. (23), (25) and (27) clarifies the different qualitative behaviour shown by the RHP measure with respect to the other ones in Fig. 1. Indeed, the increasing value of the former measure is due to the fact that, for increasing , the number of periods of negativity of the dephasing rate increases and with it the terms contributing to the sum of Eq. (23). On the contrary, the other measures all depend on the dephasing factors calculated at times at which the direction of information flow changes, i.e. and . For increasing values of , in the parameter space, however, , hence the values of both and decreases, as one can easily see from Eqs. (25) and (27).

From a physical point of view, having in mind the interpretations that we discussed in Sec. III, this means that, while the number of reverse jumps always increases with (as the number of periods of negativity in the dephasing rate increases), the information backflow has a maximum for a certain values of and then decreases due to the fact that the amplitude of oscillations in the decay rates become smaller and smaller.

### iv.3 Two qubits in independent environment: the model

We now turn our attention to a bipartite system consisting of two qubits, and , individually coupled to their own identical and non-correlated environment. The dynamical map in this case is given by , and the corresponding master equation is the sum of two identical Lindblad terms of the form of Eq. (17), describing the dynamics of each qubit, both characterized by the same dephasing rate .

RHP Measure

From the form of the master equation one sees immediately that the RHP measure for two independent qubits is exactly additive. The measure has a simple expression for any form of spectral density, i.e. of dephasing rate . For the Ohmic class of spectra we can again plot as a function of obviously obtaining exactly the same qualitative behavior as the one of Fig. 1.

BLP Measure

Already for the most straightforward generalization of the single qubit channel, namely two qubits in identical independent environments, the problem of finding the optimal pair of states maximizing the increase of the trace distance is non trivial. Even more because in practice we need to fix the time interval over which we describe the evolution and, in general, the optimal pair does depend on the chosen time interval. Here we have performed extensive numerical optimization using random pairs of states (See also the plots in Appendix 2). We have compelling evidence that the optimal states in this case are , i.e., product states of the single qubit optimal pairs, as shown in Fig 4.

We note in passing that these optimal states do depend on the specific form the the spectrum. For the Ohmic class here considered they are always of the form , but for other forms of spectral densities such as the one of the Bose-Einstein condensate reservoir Bose () of Ref. Carole () the optimal pair is different (pair of Bell states), despite the fact that the operatorial form of the master equation is the same of the one here considered.

Having this in mind, and remembering the form of the dynamical map , one obtains that for this specific model the BLP measure for two independent qubits is exactly that of one qubit, i.e., it is given by Eq. (25). We stress once again that this result relies on the specific form of the decoherence factors that we have calculated for the Ohmic class of reservoir spectral densities. In the model of Ref. Carole (), on the contrary, the measure is sub-additive.

LFS Measure

Numerical evidence indicates that the optimizing state for the measure is the two-qubit maximally mixed state. Notice that this is a product state of states optimizing the single qubit channel discussed in Sec. IV A, hence the additivity property is satisfied As in the single qubit case here again the simplified measure gives still the exact value of .

BCM Measures

For any number of qubits interacting with independent identical environments the dephasing channel is degradable for all values of parameters. Hence both measures based on capacities of quantum channels are additive. Moreover, having in mind that in the case of one-qubit dephasing channel both capacity measures are equal to , which is also additive, we can conclude that again these three measures are equivalent, =.

We conclude this subsection by noticing that, when compared to the single qubit case, the two-qubits in independent environments presents no new features. A comparison of the renormalized measures gives a figure that is exactly identical to Fig. 1. All measures in this case are additive, except for the BLP measure having the property that the measure for one qubit is the same as the measure for two qubits.

### iv.4 Two qubits in common environment: the model

The next level of generalization of the simple dephasing model consists in assuming that the two qubits see a common environment inducing pure dephasing. We will consider specifically the model described in Ref. puremodel2 (). As far as we know this is the first time that for this model the measures here considered are investigated and compared. One of the properties of common environments is the presence of a cross-talk term acting as an effective reservoir-mediated interaction between the qubits. Intuitively we expect that the presence of this term may affect additivity property present in the individual environments case.

The master equation describing the dynamics of the composite system is given in Refs. Carole (); ME (). The time evolution is now described by two time-dependent coefficients and . The former one is the dephasing rate of the single qubit case appearing in Eq. (17) while the latter one is the cross-talk term mentioned above. The master equation is in Lindblad form with time dependent dephasing rates .

Also in this case an exact analytic solution can be found. The density matrix at time takes the form puremodel2 (),

 ρt=⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜⎝1e−Γ(t)e−Γ(t)e−Γ−(t)e−Γ(t)1e−Γ+(t)e−Γ(t)e−Γ(t)e−Γ+(t)1e−Γ(t)e−Γ−(t)e−Γ(t)e−Γ(t)1⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟⎠∘ρ(0), (28)

where is the Hadamard product and,

 Γ±(t) = 2Γ(t)±δ(t) =

with given by Eq. (18) and

 δ(t)=4∫t0dt′γ2(t′). (30)

The transit time describes the time it takes for a wave propagating at the characteristic speed of sound to travel from one qubit to the other, given that the qubit distance is puremodel2 (). As before, for the sake of simplicity, we consider only the zero temperature reservoir case.

RHP Measure

From the form of the master equation it is straightforward to show that the RHP measure takes the form

 NRHP=−2∫γ+(t)<0dtγ+(t)−2∫γ−(t)<0dtγ−(t). (31)

Notice that it is sufficient that one of the coefficients appearing in the master equation is non-zero to violate divisibility and give a non-zero value of the measure. If we now specify our analysis to the Ohmic class of spectral densities characterized by the parameter we can numerically prove that the measure is super-additive for any value of .

In Fig. 2 we plot versus (red stars) for increasing values of separation between the qubits. Even if not clearly visible from the plots, there exists a critical value of in correspondence of which the dynamics changes from Markovian to non-Markovian. This value, however, depends on the distance between the qubits. We have calculated numerically that the critical value is for case i), for case ii) and for case iii) for the time period we consider. Generally increases for increasing values of the distance between the qubits, attaining its maximum value for when and we re-obtain the case of independent environments. Therefore, for , the measure is additive in the sense that the measure of the two qubit case is equal to twice the measure for each individual qubit.

BLP Measure

The common dephasing environment shows in an exemplary way the subtle aspects connected to the optimization procedure in the definition of the BLP measure. In this case we have shown numerically that the optimizing pair depends both on the value of and on the distance between the qubits, as both are important parameters in the effective spectrum seen by the qubits. More precisely, the changes in the optimizing pair stem from the complex evolution of the cross-talk term .

Extensive optimization procedures allows us to conclude that the maximizing states are either the super- or the sub-decoherent Bell states and , depending on and , for any finite value of . This is shown in detail in Fig. 5 and discussed in Appendix 2. Note that the decoherence factors of the super- and sub-decoherent states are and , respectively.

The analytical expression for the BLP measure can be written as Carole ()

 NBLP=max{NΦ,NΨ}, (32)

where is the measure if the sub-decoherent Bell states form the maximizing pair and is the measure if the super-decoherent Bell states form the maximizing pair. Time intervals again indicate the periods of information backflow, manifested as .

From the analytic expression of one sees immediately that, also in this case, BLP non-Markovianity coincides with non-divisibility. However, the qualitative behavior of the BLP measure when changing the reservoir spectrum is different from that of , as shown in Fig. 2. We note that, for a given value of (or equivalently of ), the change in the optimizing pair is clearly visible (see Figs. 2 ii) and 5 a) ii)).

Numerical investigation also shows that the measure is super-additive as a result of the qubit dephasing collectively through environment-mediated interactions, in contrast to the independent-environment case. For the measure reverts to the independent case with optimal pairs and super-additivity is lost.

BCM and LFS Measures

The effect of the cross-talk term in the considered model of common environment can be clearly observed for all three measures, , and , especially when one compares the case when two qubits are very close to each other, , with the two cases when we take the qubits further and further apart, for and , see Fig. 2.

Generally, the two channel capacity measures and the LFS measures have a similar behavior with the exception of the case in which presents a different feature when is varied. More specifically, has two peaks, a big one for , and an additional small one for . As the distance between the qubits increases, the small peak amplitude decreases and eventually vanishes, while the bigger peak moves towards the value typical of the independent environments case, i.e. .

This difference can be understood by looking at the optimizing states. Numerical investigation shows that when the qubits are closeby (Fig. 2 i)) the optimizing states of all three measures are of rank 2 with eigenvalues , where . The corresponding values of and differ from those that would be obtained had the optimal state been the maximally mixed one. On the contrary, due to the presence of the term in the definition of the entanglement assisted capacity, takes a value similar to the one it would have if the optimizing state were the maximally mixed one.

When the optimizing state for both BCM measures is the maximally mixed state for all values of . Notice that this is the same state that is optimal in case of independent environments and also here we obtain . Finally, for the optimizing states are close to maximally mixed state, these are states of rank 4 with eigenvalues given by , where for . From numerical analysis we also know that similarly to , the measures , and are super-additive.

## V Amplitude Damping Channel

Let us now consider the case in which the interaction between the quantum system and its environment leads to energy exchange between the two, resulting in dissipative open system dynamics. As we did in Sec. IV we will focus on exemplary open system models amenable to an exact analytical solution as this allows us to gain a solid understanding of the physical phenomena associated with reservoir memory.

Once again we proceed for increasing levels of complexity. We consider first the single qubit case interacting with a quantized bosonic field with both Lorentzian and Photonic Band Gap (PBG) spectra. For the single qubit Lorentzian case both the BLP and the BCM measures have been studied numerically in Refs. BLP () and Bogna (), respectively. While only the BCM measure has been investigated before in the Photonic Band Gap model here used, the other measures indeed have not. We then discuss for the first time the generalisation to the case of two qubits immersed in two independent identical environments.

The common environment scenario is not considered here because both the LSF and the quantum capacity measures present a high level of difficulty in this case. It seems indeed that the problem of calculating classical or quantum capacity for two qubits interacting with a common environment has never been considered in the literature. Here the optimization problem is amplified by the fact that it should be performed at each time instant of the evolution.

### v.1 Single qubit: the model

The dynamics of a single amplitude damped qubit is captured by the time-local master equation bp ():

 dρtdt=γ1(t)[σ−ρtσ+−12{σ+σ−,ρt}], (33)

where are the spin lowering and rising operators and

 γ1(t)=−2R˙G(t)G(t). (34)

The function depends on the form of the reservoir spectral density and is given in Appendix A for the two models here considered.

The state of the density matrix of the qubit at time can be written in terms of the initial density matrix elements () as follows

 ρt=⎛⎜ ⎜⎝1−|G(t)|2ρ22G(t)ρ12G∗(t)ρ∗12|G(t)|2ρ22⎞⎟ ⎟⎠. (35)

The dynamics of a single amplitude damped qubit is captured by the time-local master equation bp ():

 dρtdt=γ1(t)[σ−ρtσ+−12{σ+σ−,ρt}], (36)

where are the spin lowering and rising operators and

 γ1(t)=−2R˙G(t)G(t). (37)

The function depends on the form of the reservoir spectral density and is given in Appendix A for the two models here considered.

The state of the density matrix of the qubit at time can be written in terms of the initial density matrix elements () as follows

 ρt=⎛⎜ ⎜⎝1−|G(t)|2ρ22G(t)ρ12G∗(t)ρ∗12|G(t)|2ρ22⎞⎟ ⎟⎠. (38)

### v.2 Single qubit: the measures

RHP Measure

Since the master equation is in Lindblad form with time-dependent coefficients it is straightforward to evaluate the RHP measure for a generic spectral density EM ().

 NRHP=−∫γ1(t)<0dtγ1(t). (39)

We consider first the case of a Lorentzian spectrum

 J(ω)=γMλ22π[(ω−ωc)2+λ2], (40)

with an effective coupling constant, the width of the Lorentzian and the peak frequency. When the qubit frequency, denoted , coincides with (resonant Jaynes-Cummings model), the dynamical map is non-divisible for , with bp (). From this critical value diverges as a direct consequence of the divergent behavior of . Conversely, in the weak coupling regime, i.e. , is positive for all times and hence the channel is always divisible ().

For the PBG model PBG (), using Eqs. (37) and (54) we can study the Markovian to non-Markovian crossover as a function of the reservoir parameter , with the detuning of the qubit frequency from the edge frequency of the band gap spectrum, and a characteristic frequency. Positive values of correspond to the case in which the qubit is outside the band gap region while negative values of correspond to the qubit in the band gap region. In the latter case the well-known phenomenon of population trapping occurs as the emission of energy in the reservoir is strongly inhibited.

For , the rate temporarily attains negative values for certain time intervals. In fact, due to population trapping, for the asymptotic long time limit is characterized by small amplitude oscillations between positive and negative values which persist as . This eventually leads to a divergency not only of the measure but of all non-Markovianity measures. In any practical experimental situation, however, the time of the experiment is finite. We will therefore calculate the measures for a fixed time interval, longer compared to the typical times of the system but, of course, shorter than the system-reservoir correlation time which in this case is .

In Fig. 3 ii) we plot the RHP measure (red stars) for the PBG reservoir as a function of the parameter . As we can see from the plot the measure has a sudden peak at values of close to the edge , reaching its maximum value for before vanishing for . For increasingly negative values of under the critical point, RHP non-Markovianity measure decreases to small but finite values. This is due to the decreasing amplitude of the oscillations in the decay rate.

BLP Measure

We begin by deriving the analytical expression for EM ():

 NBLP=−maxm,n∫γ1<0dtγ1(t)|G(t)|3m2+0.5|G(t)||n|2√|G(t)|2m2+|n|2. (41)

where and are coefficients to be optimized. We have compelling numerical evidence that the maximizing states are the orthogonal states and for both the Lorentzian and the PBG spectral densities for any time . Hence the BLP measure takes the form

 NBLP=−12∫γ1<0dtγ1(t)|G(t)|. (42)

As we expect when only one decay rate is present in the master equation, if and only if the dynamics are non-divisible i.e., .

Figure 3 shows (blue asterisk) for different values of i) and ii) for the Lorentzian and PBG spectra, respectively. The behavior is qualitatively similar to the one of the RHP measure. In the PBG case the peak of non-Markovianity is slightly shifted towards more negative values of . In Ref. Rug (), the BLP measure and RHP witness are calculated for quantum harmonic oscillators in a band gap showing that both measures are sensitive to the edge of the gap, which is what we also observe.

BCM and LFS Measures

For the amplitude damping channel the quantum and entanglement-assisted classical capacities, which we indicate here with and , respectively, are calculated numerically num1 (); num2 (). The states optimizing and are now time-dependent. One finds CQAD () the following formulas , and , which still need a simple optimization over the probability . The latter formula holds only for , otherwise . This is due to the fact that the amplitude damping channel is degradable for , while for is anti-degradable with zero quantum capacity.

The behaviour of the BCM and LFS measures in the two cases of amplitude damping channels is illustrated in Fig. 3. For both the Lorentzian reservoir spectrum and the PBG the measures and take non-zero values if and only if the amplitude damping channel is non-divisible. Notice that the measures and have very close values. This may seem not surprising given that both measures are based on quantum mutual information. However, the examples show that there is no relation between them even in the simple amplitude damping model here considered. Indeed a strong dependence on the form of the environmental spectrum can be noticed. More precisely, in the case of the Lorentzian spectrum we have , while in the PBG model the opposite relation holds (see Fig. 3 i) and 3 ii), respectively).

We would like to emphasize the difference in the behavior of for the Lorentzian reservoir spectrum. As shown in Fig. 3 i), indeed, unlike the other measures is equal to zero even for a non-divisible channel and detects non-Markovianity only in a very strong coupling regime, i.e. when . This is due to the fact that the amplitude damping channel is anti-degradable for so, from a quantum information processing point of view, only revivals that occur in the region are important.

The above example is consistent with the intuitive idea that the transmission of quantum information along a quantum channel is more sensitive to noise than the transmission of classical information (although assisted by entanglement shared between Alice and Bob). Once again this conclusion is, however, spectrum-dependent. In the case of the PBG model (Fig. 3 ii)) it is possible to set the parameters such that the noise in the channel has almost the same effect on both kinds of information. This is possible for , because in this regime oscillates only above the value , but it is no longer true for as shown in Fig. 3 ii) – the biggest difference occurring for .

### v.3 Two qubits in independent environment: the model

For two qubits interacting with identical non-correlated environments the time evolution can still be calculated analytically PRL (). The solution is given in Appendix A. It is straightforward to confirm that, as for the pure dephasing case, the corresponding master equation can be written as the sum of two Lindblad-like terms, describing the dynamics of each qubit respectively, with time-dependent coefficent given by Eq. (37).

RHP Measure

Directly from the form of the master equation, we immediately can show that

 NRHP=−2∫γ1(t)<0dtγ1(t). (43)

As one would expect the measure is additive and, hence, for the PBG model it behaves identically to the single qubit case of Fig. 3 ii). On the other hand, for the Lorentzian spectrum, when the dynamical map is non-divisible as it is in the one qubit case.

BLP Measure

We numerically prove that for the case of the Lorentzian spectrum, the maximizing pair is . In this case we obtain the following expression for the BLP measure

 NBLP=−∫γ1<0dtγ1(t)|G(t)|−2|G(t)|3+1.5|G(t)|5√2−2|G(t)|2+|G(t)|4. (44)

This expression is clearly different from Eq. (42) for the single qubit case, and we can show that the measure is sub-additive in this case. However, its qualitative behavior as changes is exactly the same as the single-qubit case and the renormalized value of gives exactly the same curve as the one shown in Fig. 3 i) (blue asterisk).

The Photonic Band Gap model presents a number of difficulties. Indeed in this case the pair of states maximizing the increase in trace distance is very strongly dependent on the time interval chosen. We numerically calculate the measure as a function of in Fig. 4 a) iii). The non-Markovianity measure corresponds to the highest value of each column of states. In more detail, from Fig. 4 a) iii) we see the measure is maximized for initial pairs of mixed and pure states (blue dots) for , maximally entangled (purple dots) for , pure (pink dots) for and the tensor product state (yellow dots) for . We have not been able to exactly identify the states for which the increase in trace distance is maximal, even for a fixed time interval. By comparing the numerical value of with the single qubit case of Fig. 3 ii), we see however that also in this case the renormalized quantity has the same qualitative behavior for one and two qubits. In this case we have verified that the BLP is superadditive for and subadditive for . Moreover, the measure is zero if and only if the channel is divisible.

LFS Measure

Extensive numerical optimization shows that the state maximizing the quantum mutual information in Eq. (11) for two independent identical amplitude channels is of the form , where state is the maximizing state for the one-qubit channel discussed in Sec. V B. Hence, as for the two-qubit independent dephasing channels, the measure is additive. This holds for both the Lorentzian and the PBG spectral densities. Therefore, the two-qubits behavior of the measure for different values of or is exactly the same as the one shown in Fig. 3.

BCM Measures

Having in mind that whenever the amplitude damping channel is not degradable it is anti-degradable, and hence has zero quantum capacity, one can clearly see that the measures and are additive and therefore display identical behavior with respect to the system parameters as the one discussed in the one qubit scenario, shown in Fig. 3.

## Vi Discussion and Conclusions

Let us now discuss the comparison between the measures for the single and composite open quantum systems here considered. The first observation that appears evident when looking at Figs. 1, 2, and 3 ii). is that, generally, the behavior of the RHP measure is different from that of all the other measures. Indeed, after the crossover from Markovian to non-Markovian, this measure tends to present a monotonically increasing behavior, while the other measures often have a maximum, i.e. there exist values of the reservoir parameters for which the memory effects are maximal. This fact can be traced back to the very definition of RHP measure, which counts and sums the areas of negativity of the time-dependent decay rates in the master equation. Often, the more structured is the environment, the greater is the number of negativity intervals and therefore the bigger is the RHP measure. Physically, the number of reverse jumps is increasing too, leading to greater re-coherence. However, the measure proves problematic for the Lorentzian spectrum where, as a direct consequence of the decay rate diverging when the dynamics is non-divisible, the measure diverges. Also, we notice that this measure is additive for independent reservoirs, and the the qualitative behavior for two qubits in either independent and common (dephasing) environment is the same. For the other measures the situation is not so straightforward, as we explain below.

We start from the pure dephasing cases, Fig. 1 (single qubit and two qubits in independent environment) and Fig. 2 (2 qubits in common environment) show a clear similarity in the behavior of the BLP, LFS and BCM measures, in the sense that they all have a peak for values of between 2 and 4. This means that manifestations of memory in terms of increase of information on the system, increase of system-ancilla total correlations, or in terms of increase of channel capacities arise in a similar way when modifying the form of the spectrum.

In the common environment case of Fig. 2, we note that, contrarily to the RHP measure, the other measures show a stronger sensitivity to the distance between the qubits, which in turn is connected to the cross-talk term, i.e. the environment mediated interaction that is known to contribute to the overall memory effects Laura (). The BLP, LFS and BCM measures seem to show a narrower peak as the distance is increased, consistently with the independent qubit case of Fig. 1.

The amplitude damping case presents clear differences and, contrarily to the pure dephasing case, the crossover between Markovian and non-Markovian is not the same for all the measures. We note first of all that the presence of energy exchange between the system and the environment introduces a new relevant time scale, or frequency, i.e. the Bohr frequency of the two-level system forming the qubit. In the dephasing case the structure of the spectral density and the presence of peaks in resonance with is not related to the occurrence of non-Markovian dynamics. Rather, it is the form of the spectrum at the origin that dictates the presence or not of re-coherence and revivals of information Timediscord ().

The situation is clearly different in the dissipative case where the qubit is more likely to interact with environmental modes of the same frequency of . A clear sign of this behavior is shown in Fig. 3 ii) for the Photonic Band Gap case. Here all non-Markovianity indicators display the same key feature, i.e., they have their maximum around , where the coupling between the qubit and the modes is the strongest Barry (). In this case, indeed, the qubit exchanges periodically energy with the environment and its population shows Rabi oscillations. Consistently, memory effects associated to the energy exchange between system and environment also lead to oscillations of the information content of the system (back flow of information), total correlations between system and ancilla, and channel capacities.

Finally, another important point to notice emerges from the comparison of the (finite) measures for the Lorentzian model on resonance. Here the behavior of the BLP and entanglement-assisted capacity is similar while for the quantum channel capacity measure, a much stronger coupling with the environment is required to have a partial increase in the maximum rate of information transfer for increasing times or lengths of the channel. As we have discussed in Sec. V B, this is not surprising as quantum information is more sensitive to environmental noise than classical information.

The overall picture that surfaces is one in which, despite the obvious differences between the measures, their corresponding physical mechanisms contributing to memory effects often appear correlated and show a similar connection with the reservoir spectral features. In conclusion the non-Markovianity measures give different perspectives on the same complex physical process, a full understanding of which requires them all.

## Vii Acknowledgements

B.B. thanks the Open Quantum Systems and Entanglement group for the hospitality, and acknowledges financial support form the Finnish Emil Aaltonen Foundation and the National Science Center project 2011/01/N/ST2/00393. D. C. was partially supported by the National Science Center project DEC-2011/03/B/ST2/00136. C.A. acknowledges financial support from the EPSRC (UK) via the Doctoral Training Centre in Condensed Matter Physics. The authors would also like to gratefully acknowledge Oliver Brown for his assistance in running numerical simulations using his computer.

## Viii Appendix

### viii.1 Mathematical Description of Physical Models

In this section, we present in detail the mathematical description of each system considered in this work.

#### viii.1.1 Purely Dephasing Model

One Qubit The Hamiltonian of the system is given as puremodel2 ():

 H=ω0σz+∑kωka†kak+∑kσz(gzak+g∗ka†k), (45)

with the qubit frequency, the frequencies of the reservoir modes, the annihilation (creation) operators of the bosonic environment and the coupling constant between each reservoir mode and the qubit. In the continuum limit , where is the reservoir spectral density puremodel2 (); NMPure4 ().

It is simple to obtain the operator-sum representation with time-dependent Kraus operators; and .

Knowledge of the Kraus operators allows one to immediately also write the complementary map, needed to calculate both the coherent information and the entropy exchange which appears in the definition of the mutual information of the channel:

 ~ϕDt[ρ] = 12[(1+e−Γ(t))|1⟩e⟨1|+(1−eΓ(t))|2⟩E⟨2|] (46) + 12√1−e2Γ(t)Tr(ρσz)(|1⟩E⟨2|+|2⟩E⟨1|).

We write in full Eq. 18 to give the explicit form of :

 Γ(t) = 2~Γ[s]−1+s(1−(1+t2)−s/2(cos(sarctan(t)) (47) + tsin(sarctan(t))).

Two Qubit The Hamiltonian which describes the two qubits for the purely dephasing case is as follows: puremodel2 ():

 H = ωi0σiz+ωi0σjz+∑kωka†kak (48) + ∑kσiz(gika†k+gi∗kak)+∑kσjz(gjka†k+gj∗kak),

The expression for the “cross-talk” term is given below:

 δ(t) = 2Γ[s]−1+s({(1+t2s)[1+(ts−t)2]}−s2{[1+(ts−t)2]s2cos[sarctan(ts)]+ts[1+(ts−t)2]s2sin[sarctan(q)] − (1+t2s)s2(cos[sarctan(ts−t)]+(ts−t)sin[sarctan(ts−t)])}+{(1+t2s)[1+(ts+t)2]}−s2{[1+(ts+t)2]


text:
# Tag Info

4

It isn't the oldest thing we can see. Most of the hydrogen, helium and deuterium nuclei that are around in the universe now, were created in the time period between a few seconds and about 15 minutes after the big bang. The abundances of these nuclei in the universe is a direct probe of the physical conditions, and time evolution of those conditions, at ...

3

Interesting question! Let me see if I can shed some light with an analogy. Btw, I shall be referring to John's answer at points. Studying or researching in astronomy is very much like criminal investigation. You have the crime, you search for clues which are used to reconstruct the events of the crime. Here, we have a crime, the construction of the universe,...

18

You are quite correct that we can't see what happened before the CMB (this time is known as recombination) but this is not unusual in Physics. For example we can't see what happens at collisions in the Large Hadron Collider. All we can see is the debris that comes flying out of the collisions. But we understand the physics involved so by measuring the ...

-1

So , according to Sir Stephen William Hawking , NOTHING existed before Big Bang , as many of you may have seen in the interview of Sir Stephen Hawking (if not I had put a link below , just check it) . But if we think deeply for a while, if our universe has started witha Singularity (Big Bang),according to Big Bang Theory , and is going to end at a ...

3

As I said there's a mathematical laws behind this approximation. We use the Friedmann equations and EFE : \begin{cases} 3\frac{\dot{a}^2}{a^2}+3\frac{kc^2}{a^2}-\Lambda c^2=\frac{8\pi G}{c^2}\rho \qquad(1) \\[2ex] -2\frac{\ddot{a}}{a}-\frac{\dot{a}^2}{a^2}-\frac{kc^2}{a^2}+\Lambda c^2=\frac{8\pi G}{c^2}p \qquad(2)\\[2ex] R_{ij}-\frac{1}{2}Rg_{ij}=\frac{...

1

Of course it is approximation, as any almost any measurement beyond simple counting involves approximation, but there is quite a bit of evidence based on observation fitted to known laws. The main evidence springs from fitting observations of cosmological parameters, Hubble's constant $H_0$, density $\Omega$, curvature $\Omega_k$, and dark energy $\Omega_\... 0 To add to some other answers, it is possible for a surface to be intrinsically flat but also to be closed. A ball has positive curvature, but a ring like a donut or a life preserver has zero overall curvature, with the locally negative bits exactly cancelling the locally positive ones; you can even divide it up into a neat checkerboard. If you imagine a ... 2 The current hydrogen density in the universe is approximately$0.04 \times 6$atoms per cubic metre. If we wind the clock back, this number goes up as$(1+z)^3$, where$z$is the redshift. The CMB formed at$z \sim 1100$, thus the number density of electrons in the universe just prior to this was$n_e \sim (1+1100)^3 \times 0.04 \times 6 = 3.2\times 10^{8}\$ ...

Top 50 recent answers are included


text:
# MathJax in Markdown :: 20 Jul 2011

I had some issues getting MathJax running smoothly alongside Markdown. The main issue stemmed from Markdown not providing a way to temporarily escape from its text transformations, so some LATEX would get interpreted as Markdown.

The only way I know of to prevent text transformations in Markdown is through the code block (prefix with 4+ spaces) and inline code (surround with ) features. However, both of those wrap the result in some HTML tag (<pre> for the first, <code> for the second). I decided to use the inline code feature as the basis for inserting my math.

I can insert math by typing, for example $$\del \cdot \vec{B} = 0$$. To make this work, I had to use the following MathJax configuration:

MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});

This prevents MathJax from skipping <code> tags. This could potentially cause issues if I used the sequences \(, \[, or  in a normal (non-math) code block, but I think it's safe to say that those sequences won't show up in most of my code.

The next step was to make sure MathJax <code> tags weren't actually styled like "normal" <code> tags. To do this, I added this to my MathJax configuration:

MathJax.Hub.Queue(function() {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for(i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});

with this in my CSS:

code.has-jax {font: inherit; font-size: 100%; background: inherit; border: inherit;}
`


text:
### CFD Modeling for Turbomachinery using MRF Model

Rate this item
07 May

Having already gone through our blog series of CFD modeling of turbomachinery, wherein we discussed about the CAD Repair and Grid Generation we shall now explore the different solver models available in a commercial software package. CFD modeling of flows within systems containing moving components (e.g. turbomachines) are performed by resorting to moving reference frames (MRF). There are a number of both generalized and specialized commercial softwares available that apply moving reference frames for both translating and rotating systems. MRF approach finds application in a wide range of systems like turbomachinery, mixing equipment, electric motors and generators, rotating passages & land and air vehicle motions. In the current blog we shall try to understand applying MRF model for turbomachinery explained with the help of a simple test case.

The MRF approach however requires a special treatment as it has to accord with the modeling and analysis of various existing complex rotating system having components like a stator, rotor in single or multistage. Certainly all the parts attached to the rotating shaft are as well rotating with a certain angular velocity relative to the machine axis, whereas the stationary parts like the stator, casing, inlet(s), exit(s) etc., are devoid of any motion. Such flows for a stationary observer appears unsteady (around the moving parts) though apparently its a steady state case while when viewed by an observer posted on the rotor appears steady flow. For unsteady (transient) state flow problems the position of the observer hardly matters and is unsteady. Hence what remains important point is the synergy of information between the stationary frame and the moving reference frame.

For solving turbomachinery problems using CFD there exists specific and special models to be applied, and one of the models being popular in use is the Moving Reference Frame model. In MRF model a moving reference frame permits an unsteady problem (with respect to the absolute reference frame) to become steady in respect to the moving reference frame. In other words the complete rotor domain is assumed to be rotating at the same angular velocity of the rotor.  Since basically all turbomachinery flows are unsteady in nature, the moving reference frame model approach makes simpler to solve these problems in CFD. It makes it easier to specify appropriate boundary conditions requiring less time and computational efforts and therefore is the preferred choice in industrial practices over rest of the models.

When a moving reference frame is activated, the equations of motion are modified to incorporate the additional acceleration terms i.e., Coriolis and centripetal acceleration terms which occur due to the transformation from the stationary to the moving reference frame. By solving these equations in a steady-state manner, the flow around the moving parts can be modeled.

Few of the models available in commercial softwares like ANSYS FLUENT are :

• Single Reference Frame model (SRF)
• Multiple Reference Frame model (MRF)
• Mixing Plane Model (MPM)
• Sliding Mesh Model

For simple problems, it may be possible to refer the entire computational domain to a single moving reference frame. This is known as the single reference frame (or SRF) approach. The use of the SRF approach is possible, provided the geometry meets certain requirements. For more complex geometries like a centrifugal pump with volute casing, it may not be possible to use a single reference frame. In such cases, the domain is differentiated into multiple cells zones, with well-defined interfaces between the zones. The manner in which the interfaces are treated leads to two approximate, steady-state modeling methods for this class of problem: the multiple reference frame (or MRF) approach, and the mixing plane approach. If unsteady interaction between the stationary and moving parts is important, Sliding Mesh approach is employed to capture the transient behavior of the flow.

Before getting into the details of the individual models let us get familiar with few terms.

• Surface of revolution : A surface of revolution is a surface generated by rotating a two-dimensional curve about an axis. e.g. cylindrical, spherical, conical.
• Interface : A boundary across which two independent domains meet and across which information is exchanged. The interface separating rotating and stationary domain must be a surface of revolution with respect to axis of rotation of the rotating zone. The interface should be placed such that there are no stationary components which are not a surface of revolution, inside the rotating zone.

The modified equations for moving reference frame are as given below:

Conservation of mass:

$\frac{\partial(\rho)}{\partial t} + \nabla \cdot \rho \vec {v_r} = 0$

Conservation of momentum :

$\frac{\partial(\rho \vec v_r)}{\partial t} + \nabla \cdot (\rho {\vec v_r} {\vec v_r}) + \rho (2\vec {w} \times \vec {v_r} + \vec {w} \times \vec {w} \times \vec{r})= - \nabla p + \nabla (\bar {\bar {\tau_r}}) + \vec{F}$

$\vec v_r = \vec v - \vec u_r$

$\vec u_r = \vec{\omega} \times \vec{r}$

where $\vec{v_r}$ and  $\vec{v}$ is the absolute velocity, $\vec{u_r}$ is the whirl velocity.

The momentum equation contains two additional acceleration terms i.e. the Coriolis acceleration: $2\vec{\omega} \times \vec{v_{r}}$ acceleration terms: the Coriolis acceleration and the centripetal acceleration: $\vec{\omega} \times \vec{\omega} \times \vec{r}$.

Single Reference of Frame (SRF) model:

Many problems permit the entire computational domain to be referred to as a single rotating reference frame (hence the name SRF modeling). In such cases, the equations given above are solved in all fluid cell zones. Steady-state solutions are possible in SRF models provided suitable boundary conditions are prescribed. But the wall boundaries must meet certain requirements, as mentioned below:

• The wall which is moving with the reference frame may assume any shape.
• Boundaries which are stationary should be the surface of revolution about axis of rotation.

An example where SRF approach can be applied is shown above. In the example, the domain contains a rotor which is moving at certain angular velocity and a stationary wall. In this case the problem can be solved using SRF approach, since no stationary walls are present inside the domain and the outer stationary wall is surface of revolution and meets the above criteria. But when the problem involves multiple rotating parts or stationary components (like guide vanes in turbines) that are not the surface of revolution, the SRF modelling approach fails. Thus a different approach has to be adopted to solve such kind of problems by breaking the domain into stationary zone and rotating zone with interface separating them. Based on the manner in which interface is treated two approaches are defined namely :

1. Multiple Rotating Reference Frames

• Multiple Reference Frame model (MRF)
• Mixing Plane Model (MPM)

2. Sliding Mesh Model (SMM)

Here we shall discuss more about only the MRF model.

Multiple Reference Frame (MRF) model:

The MRF model is the simplest of the two approaches for multiple zones. It is a steady-state approximation in which individual cell zones move at different rotational and/or translational speeds. The flow in each moving cell zone is solved using the moving reference frame equations. If the zone is stationary $(\omega = 0)$, the stationary equations are used i.e., moving reference frame equations are solved in rotational zone and stationary equations are solved in stationary zone and the information is exchanged at the interface. The properties of the flow at the interface between the stationary and rotating zones is directly translated in MRF. In MRF approach there is no relative motion between moving zone with respect to the adjacent zone, the grid is fixed for computation. This is analogous to freezing the motion of the moving part in a specific position and observing the instantaneous flow field with the rotor in that position and hence, the MRF is often referred to as the "frozen rotor approach."
An example that illustrates the MRF approach is shown with an above (image). In the image apart from the rotor and stationary walls there are stationary baffles present inside the fluid zone. Thus an interface is defined which is a surface of revolution about the rotor axis to distinguish between stationary and rotating zone. MRF model should be used when the flow is not complicated and if the interaction between rotor and stator in a turbine stage is weak. With a MRF simulation rotating wakes, secondary flows, leading edge pressure increases etc.will always stay in exactly the same positions. This makes the simulation very dependent on exactly how the rotors and the stators are positioned. Usually MRF model is used to calculate flow field that can be used as initial condition for sliding mesh calculation.

Test case:

Below shows a test case on simulation of fan in a room using MRF model. The objective of the test case is to distinguish the two zones i.e. rotating and stationary with an interface to solve using MRF model  and to visualize the flow circulation around the objects inside the room. The CAD model of the room with ceiling fan MRF boundary and other details is shown below:

• Objective: To determine whether the velocity of air at seating area lies in the human comfort range
• Fan rotation speed: 200 rpm
• Fan blades: 3, each separated by an angle of 120
• Fan blade twist angle : 8

The contours of velocity in both horizontal and vertical plane in the middle and velocity vector is shown below.

From the velocity contour and vector in the middle plane, the convection current can be seen clearly. As seen in the images above it becomes clear that the velocity of air behind the blades is small or almost nil, but increases as it crosses the moving blades in the downward direction. Also from the velocity contour in the middle plane it can be seen that the air is circulating around chairs causing the desired comfort.

Reference:

##### Dr. Ganesh Visavale

Dr. Ganesh is a leading researcher in computational engineering, sustainable energy and its application in process industry. He has done immence contribution in LearnCAx. Before he joined post-doctoral fellowship at IIT Delhi, he was the general manager at LearnCAx. He was instrumental in conceptualization, development and implementation of online education from CCTech for CAx professional. Ganesh has a number of publications both in international journal and conference proceedings. Before CCTech, he held the position of Associate Scientist in solar thermal division at Sardar Patel Renewable Energy Research Institute, Anand.

Ganesh holds Ph.D and M.Chem. Engineering from Department of Chemical Engineering, Institute of Chemical Technology, Mumbai (formerly UDCT Mumbai).

CFD Modeling for Turbomachinery using MRF Model - 4.7 out of 5 based on 16 votes

### Latest from Ganesh Visavale

 Career Path to CFD Engineer Views : 12653 Reviewing Governing Equations of Fluid Dynamics Views : 9057

### Related items

 Tutorial: CFD Simulation of Unsteady Flow Past Square Cylinder Author : Trushna Dhote Views : 10974 Tutorial: CFD Simulation of Backward Facing Step Author : Trushna Dhote Views : 9973 Y Plus / Y+ Calculator for First Cell Wall Distance for Turbulent Flows Author : Sanket Dange Views : 20233 How to Learn CFD ? – The Beginner’s Guide Author : Vijay Mali Views : 38779 Democratization of CFD Education, Truly!! Author : Vijay Mali Views : 3048

Refresh


text:
Template for Journal of the Royal Statistical Society: Series C (Applied Statistics)

Author
Royal Statistical Society
AbstractThe style files were downloaded from the journal's homepage. Note that if your document contains other LaTeX errors, the tables will not be processed correctly. Therefore if you're getting an error message about Missing number and \statsocwidth@b etc, comment out your tables and correct other errors in your code first. Then uncomment your table code, and hit "recompile from scratch" at the bottom of the error/warning message window.


text:
# Predictable Random Numbers

Well that title is odd, right?

What I’m wanting to do here is demonstrate one way to generate random numbers using a seed . The requirement here is we need to test a number at any given time, this will be useful if we intend to use the process as a token of sort, think RSA SecureID .

Anyways I wanted to make a implementation that used Python and didn’t cost me hundreds of dollars.

The first thing I needed was a changing number, but one that only changed every 60 seconds. I decided to use a timestamp here of Year, Month, Day, Hour, Minute in UTC format. To do this I used the Python time function’s strftime method:

In [1]: import time

In [2]: timestamp = time.strftime('%Y%m%d%H%M', time.gmtime())

In [3]: timestamp
Out[3]: '201312101409'

Creating a random number using this format is useless since anyone who knows the time can recreate the output token. To resolve this I’m going to use a salt mixed in with this time string.

A 4 digit key can be used as our salt just fine:

In [1]: key = '1234'

Now we can combine the two in order to make our seed :

In [1]: myseed = key + timestamp

In [2]: myseed
Out[2]: '1234201312101409'

Excellent we have a salted number we can use as a seed, lets go ahead and use the Python random library to generate some random ranges using this seed:

In [1]: r = random.Random(myseed)

In [2]: r.randrange(000000, 999999)
Out[2]: 807766

The beauty about Python’s Random class is it takes a seed for generating random number, this way we can always guess randomness of the numbers. I also used a output number of 000000 through 999999 (that is a 6 digit random number starting with all 0s and ending with all 9s).

Below is a few functions thrown together:

import time
import random

def get_timestamp():
return time.strftime('%Y%m%d%H%M', time.gmtime())

def get_token(key):
r = random.Random('%s%s' % (key, get_timestamp()))
return r.randrange(000000, 999999)

def check_token(key, token):
cur = get_token(key)
if token == cur:
return True
return False

Using these functions lets create a token and track at what time it was created.

In [1]: !date
Tue Dec 10 08:37:19 CST 2013

In [2]: token = get_token(1234)

In [3]: token
Out[3]: 771259

Lets check if this token is valid right after creating it:

In [1]: !date
Tue Dec 10 08:37:23 CST 2013

In [2]: check_token(1234, token)
Out[2]: True

And finally lets wait about a minute and check again:

In [1]: !date
Tue Dec 10 08:38:11 CST 2013

In [2]: check_token(1234, token)
Out[2]: False

And there you have it, a working proof of concept.

I would like to mention this is purely concept code, it is not very secure. I am also not sure if the python random library is portable from Python version to version, or even instance to instance.


text:
# Basel Committee to amend leverage ratio calculation

## CEM to be ditched, but regulators still considering treatment of client margin

Proposed leverage ratio amendments have stopped short of providing a fix for the additive treatment of client collateral received by futures commission merchants (FCMs), which banks argue renders the derivatives clearing business unprofitable.

The Basel Committee on Banking Supervision is consulting on amending the method of calculating derivatives exposure, which at the moment relies on the decades-old current exposure method (CEM).

Banks see the CEM as overly simplistic and not risk sensitive, and have long called for a move to the standardised approach for counterparty credit risk (SA-CCR), which allows more exposure netting. A Basel Committee consultative document on revisions to the leverage ratio, published on April 6, officially proposes that amendment. But dealers say clearing will remain unprofitable unless initial margin received from clients is recognised as risk reducing.

"It's definitely a positive thing. CEM has a lot of shortcomings that we were concerned about, but this is not a silver bullet – it does not solve the clearing industry's problems. It helps, but there are still going to be certain client types that don't look attractive under clearing and, unfortunately, it would be the clients that regulators would most like to help. Just given the fact that we're not getting the initial margin offset, the supplementary leverage ratio might continue to be the binding constraint for supporting client business," says the head of clearing at a US bank.

To calculate a bank's leverage ratio exposure, the FCM must add the replacement cost of a derivatives position – the current market value – to its potential future exposure (PFE). The Basel Committee has proposed allowing cash variation margin to be used to reduce the replacement cost. The PFE add-on component is adjusted by setting the PFE multiplier to one, to ensure no collateral posted by the counterparty is recognised. The calculation of maturity for the PFE is based on a minimum five-day margin period of risk, which increases up to 20 days, depending on whether the transaction is margined and centrally cleared.

It's definitely a positive thing. CEM has a lot of shortcomings that we were concerned about, but this is not a silver bullet
Head of clearing at a US bank

The PFE is generated by applying a regulator-set multiplier to the notional of the trade, with the multiplier varying by underlying asset class and maturity. Allowing margin to offset the replacement cost can result in big capital savings for banks, with one example sketched out by Citi in leverage ratio analysis for Risk showing savings of more than $12 million in capital requirements between margined and unmargined SA-CCR, and a reduction of almost$42 million versus CEM.

The global head of risk at the US bank says a change to SA-CCR will result in savings of up to 50%, but this is dependent on client type.

"We're seeing pretty good benefits on the over-the-counter clearing side, to the tune of an 80% or 90% reduction for some of our clients if you include initial margin. On the futures side we see a much lower rate, with clients getting about a 30% to 40% benefit. Compared to CEM, the savings are more like 50% when not including initial margin," says the global head of risk.

### Better for some, worse for others

"It's better for certain types of portfolios, but it's worse for others," adds the head of clearing. "Credit clients are going to look much better under SA-CCR, but other asset classes such as futures, commodities or equities clients are probably not going to see the same level of benefits. If you're doing longer-dated trades in the commodities and equities space, the numbers can be quite punitive."

The Basel Committee also notes in its consultation the industry's concerns over the impact of the leverage ratio on clearing businesses, which consume billions of dollars in cash initial margin from clients and must be counted towards the exposure total. No changes are proposed at this stage, but the committee says it is "carefully considering this concern" and requests supporting data from the industry. The consultation suggests a market risk quantitative impact study being conducted by the Basel Committee this month may also supply valuable information.

On the basis of that data, the BCBS will consider "whether to expand upon the measures described, which may include permitting offsetting of a clearing member's PFE with the initial margin posted by clients" on whose behalf the bank clears derivatives transactions.

"They are looking for further data on what banks' leverage ratio numbers would look like under SA-CCR with or without an offset, and it's encouraging that they continue to consider the issue. It's an uphill battle, but it's helpful they're continuing to look into it," says the head of clearing.

Lobbying efforts have long sought to do away with the current treatment of client initial margin – something the industry argues will undermine the post-crisis push to centrally clear derivatives as a result of extra capital requirements. However, these discussions have been politically fraught and so far unsuccessful, with 60% of asset managers witnessing higher clearing costs and banks exiting the business.

### Political division

While several senior regulators support a change, including CFTC chairman Timothy Massad and Mark Carney, governor of the Bank of England (BoE), others have refused to budge – including Janet Yellen, chair of the board of governors at the Federal Reserve System, and Thomas Hoenig, vice-chair of the Federal Deposit Insurance Corporation (FDIC).

As a result of the political division, the head of clearing says the Basel Committee's refusal to allow an initial margin offset in its publication did not come as a surprise.

"It has been telegraphed to us a bit that the initial margin offset would be a challenge. The FDIC, in particular, has made very public comments about giving an offset and their resistance to it. So we were to some extent expecting this. However, the CFTC has been very supportive of this and the BoE has also made some public comments about the need for it. We continue to argue for it and ask regulators to consider it," says the head of clearing.

In the face of regulatory opposition, some banks have taken steps to mitigate the issue through a controversial accounting technique known as derecognition of initial margin. This is accomplished by separating client-received cash collateral from the bank's estate, to make it bankruptcy remote in the event of FCM default, and giving up any interest received. The portion of collateral that is derecognised does not have to be counted towards the leverage ratio.

Citi and UBS are the only two banks known to have achieved this method. Following increased dealer interest in the practice, the CFTC sent a list of questions to participating banks.

The Basel Committee consultation period on revisions to the leverage ratio closes on July 6.