text:
# Positive partial transpose

The Peres-Horodecki criterion is a necessary condition for the joint density matrix ρ of two systems A and B to be separable. It is also called the PPT criterion, for Positive Partial Transpose. In the 2x2 and 2x3 dimensional cases the condition is also sufficient.

If ρ is separable, then the partial transpose

σmμnν :  = ρnμmν of ρ, taken in some basis ∣mA ⊗ ∣μB, has non negative eigenvalues.

In matrix notation, if we write a N X M mixed state �? as block matrix:

$$\rho = \begin{bmatrix} \rho _{11} & \cdots & \rho _{1 n}\\ \vdots & \ddots & \vdots \\ \ \rho _{n 1} & \cdots & \rho _{n n} \end{bmatrix}$$

,where each ρi : j is M X M and n runs from 1 to N. The partial transpose of �? is then given by

$$\rho ^{PT} = \begin{bmatrix} \rho ^T _{11} & \cdots & \rho ^T _{1 n}\\ \vdots & \ddots & \vdots \\ \ \rho ^T _{n 1} & \cdots & \rho ^T _{n n} \end{bmatrix}$$

So �? is PPT if (I ⊗ T)(ρ) is positive, where T is the transposition map on matrices.

That necessity of PPT for separability follows immediately from the fact that if �? is separable, then (I ⊗ Φ)(ρ) must be positive for all positive map Φ. The transposition map is clearly a positive map.

Showing that being PPT is also sufficient for in the 2 X 2 and 2 X 3 (therefore 3 X 2) cases is more involved. It was shown by the Horodecki's that for every entangled state there exists an entanglement witness. This is a result of geometric nature and invokes the Hahn-Banach theorem (see reference below). From the existence of entanglement witnesses, one can show that (I ⊗ Φ)(ρ) being positive for all positive map Φ is not only necessary but also sufficient for separability of �?. Furthermore, every positive map from the C*-algebra of 2 × 2 matrices to 2 × 2 or 3 × 3 matrices can be decomposed into a sum of completely positive and completely copositive maps. In other words, every such map Λ can be written as

Λ = Λ1 + Λ2 ∘ T

,where Λ1 and Λ2 are completely positive and T is the transposition map. Combining the above two facts, we can conclude PPT is also sufficient for separability in the 2 X 2 and 2 X 3 cases.

Due to the existence of non-decomposable positive maps in higher dimensions, PPT is no longer sufficient in higher dimensions. In higher dimension, there are entangled states which are PPT. Such states have some interesting propeties including the fact that thay are bound entangled, i.e. they can not be distilled for quantum communication purposes.

### References

• Asher Peres, Separability Criterion for Density Matrices, Phys. Rev. Lett. 77, 1413–1415 (1996)
• M. Horodecki, P. Horodecki, R. Horodecki, Separability of Mixed States: Necessary and Sufficient Conditions, Physics Letters A 223, p. 1 (1996).


text:
# Cohomology of quotient space

Let be $X$ a maximal torus in a Lie group $G$. I'd like to calculate the cohomology $H^{*}(G/N(T))$. I know that it is trivial in odd degree and the base-field is even but I haven't a basic method to do this. Is there a simple method of calculation when the gruop $G$ is the unitary gruop $U(n)$?

-

If you take $G=U(n)$, then $G/T$ is the flag variety of $GL_n({\mathbb C})$. Hence its cohomology is given by Bruhat cells and as a representation of the Weyl group $W=N(T)/T)$ acting on the right on $G/T$, it is the regular representation (there are no fixed points for $W$!Use Lefschetz). Therefore, the space of invariant elements is one dimensional and is given by $H^0(G/T)$.
The same method applies to any compact connected LIe group $G$ and $T$ is a maximal torus.
the space $G/T$ is the same as $G({\mathbb C}/B$ where $B$ is a Borel subgroup of the complexification $G({\mathbb C})$ containing $T$. One is doing Bruhat decomposition for this $B$. This is standard stuff in algebraic groups. The group $N(T)/T$ acts on the {\bf right} on $G/T$ and no element has a fixed point. Hence you can apply Lefschetz fixed point formula to say that this is the regular representation of $W$. Again, this is a well known fact (perhaps old papers of Bott or Borel). – Venkataramana Jan 13 '13 at 14:23

format: plain


text:
### Analysis of the Influences of Parameters in the Fractional Second-Grade Fluid Dynamics

Published: 1 April 2022
by  MDPI

Abstract: This work proposes a qualitative study for the fractional second-grade fluid described by a fractional operator. The classical Caputo fractional operator is used in the investigations. The exact analytical solutions of the constructed problems for the proposed model are determined by using the Laplace transform method, which particularly includes the Laplace transform of the Caputo derivative. The impact of the used fractional operator is presented; especially, the acceleration effect is noticed in the paper. The parameters’ influences are focused on the dynamics such as the Prandtl number $\left(Pr\right)$, the Grashof numbers $\left(Gr\right)$, and the parameter $\eta$ when the fractional-order derivative is used in modeling the second-grade fluid model. Their impacts are also analyzed from a physical point of view besides mathematical calculations. The impact of the fractional parameter $\alpha$ is also provided. Finally, it is concluded that the graphical representations support the theoretical observations of the paper.
Keywords: second-grade fluid / Prandtl number / Grashof number / fractional-order derivative / integral transformation

#### Scifeed alert for new publications

Never miss any articles matching your research from any publisher


text:
# How to extract first line that matches pattern from a file and if pattern doesn't exist print fixed output?

I have a text file shown below:

Doc_A 123 abc
Doc_A 456 def
Doc_A 789 ghi
Doc_B 123 abc
Doc_B 456 def
Doc_C 123 abc
Doc_C 456 def
Doc_C 789 ghi
Doc_C 101 jkl

And a reference file

Doc_A
Doc_B
Doc_C
Doc_D
Doc_E
Doc_F

I want to extract the first line from text file that matches the name in the reference file and print that line and if there is no match print a certain fixed pattern as shown:

Doc_A 123 abc
Doc_B 123 abc
Doc_C 123 abc
Doc_D 10 20
Doc_E 10 20
Doc_F 10 20

I can use awk as shown below to print for matching pattern. How would I print patterns not found, certain fixed way as I require?

awk 'FNR == NR { a[$1] = 0; } FNR != NR { for (i in a) if ($0 ~ i && a[i]++ == 0) { print $0; break; } }' \ref.txt file.txt  ## 3 Answers How about deleting the entries from the lookup array as you match them, and then printing what's left at the end? $ awk 'NR==FNR {a[$1]; next}$1 in a {print; delete a[$1]} END {for (i in a) print i, "10 20"} ' ref.txt file.txt Doc_A 123 abc Doc_B 123 abc Doc_C 123 abc Doc_D 10 20 Doc_E 10 20 Doc_F 10 20  (Note that awk doesn't guarantee the order of array traversal - if that's an issue.) # Explanation While NR==FNR, we are processing the first named file (ref.txt): we create an array entry with its first (in this case, only) field as its index and then move to the next record. We don't need to assign a value to the array element. Otherwise, we are processing the second named file (file.txt). We check whether its first column has a match in the array a that we constructed from the reference file, and print the record $0 if it does. Then we delete the entry.

Deleting serves two purposes: it "uniquifies" the match, because next time we test $1 in a for the same $1, the answer will be false. It also means that after all lines of file.txt have been processed, any remaining elements in a have not been matched - we can print these in your "fixed" format in an END block.

• array traversal is not an issue. Thanks – rkatraga Apr 17 at 18:43
• Can you explain in detail, what exactly is happening here? I am unable to understand it fully. – rkatraga Apr 17 at 21:45
• @rkatraga I have added some explanation – steeldriver Apr 17 at 21:54
• This is great, I am just so amused by awk. – rkatraga Apr 17 at 22:51

Is awk a requirement for your task? grep could also be used.

Your files appear to be space-delimited. The solution below rests on the assumption that the fixed patterns in your reference file will never contain whitespace.

Let the text file be file.txt. Let the reference file be ref.txt.

$for P in$(cat ref.txt); do grep -m1 "^$P[[:blank:]]" file.txt || printf "%s 10 20\n" "$P"; done
Doc_A 123 abc
Doc_B 123 abc
Doc_C 123 abc
Doc_D 10 20
Doc_E 10 20
Doc_F 10 20

• What is white space? can you elaborate. – rkatraga Apr 17 at 19:51
• So you mean its assuming there is no whitespace before pattern? Like in this case before Doc_A? Also why is [[:blank:]] used after ^$P? what purpose does tab and space serve here? to recognize diff between Doc_A & Doc_AA? Can you clarify? Because I didn't think about it until I saw the code. Thanks in advance, I am very new, and hopefully soon enough will pick up. – rkatraga Apr 17 at 20:03 • No, I mean no whitespace in ref.txt. And yes, you are correct that the [[:blank:]] means that we require that there must be whitespace in file.txt after the pattern match, to avoid having Doc_A match Doc_AA. – Jim L. Apr 17 at 20:30 You can do it multiple ways, like as for instance : awk ' NR == FNR && !($1 in a){a[$1]=$0}
NR != FNR{print ($1 in a) ? a[$1] : $1" 10 20"} ' inp ref.txt perl -lane '$h{$F[0]} =$_ unless exists $h{$F[0]}}{
while ( <STDIN> ) {
chomp;
print(exists $h{$_} ? $h{$_} : qq<$_ 10 20>); } ' inp < ref.txt while IFS= read -r a do grep -m1 -F -- "$a" inp || echo "\$a 10 20"
done < ref.txt

Results:

Doc_A 123 abc
Doc_B 123 abc
Doc_C 123 abc
Doc_D 10 20
Doc_E 10 20
Doc_F 10 20


text:
Is eqnarray really obsolete?

I just learned in eqnarray vs align that eqnarray should be avoided in general. Ok, so I started looking at my documents to get rid of it and (as suggested) use some environment of the amsmath package instead. However, I encountered two situations where this change yields a worse output (IMHO) than with eqnarray. This may be due to my lack of knowledge how to do it right, but first I will show the two situations:

The first one is a sequence of (in-)equalities used to prove a bound (as common in, e.g., runtime complexity analysis). This one here is used to show that 2^n does not grow faster than n!.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{eqnarray*}
2^n & =                      & \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{ times}}\\
& \stackrel{n > 3}{=}    & 2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      & 16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& <                      & 24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      & 1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& \stackrel{n > 3}{\leq} & 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots \cdot n\\
& =                      & n!
\end{eqnarray*}

\end{document}

It yields the following output:

These are my attempts to use some environment of the amsmath package instead:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
2^n & =                      \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{ times}}\\
& \stackrel{n > 3}{=}    2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& <                      24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& \stackrel{n > 3}{\leq} 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots \cdot n\\
& =                      n!
\end{align*}

\begin{aligned} 2^n & = && \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{ times}}\\ & \stackrel{n > 3}{=} && 2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\ & = && 16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\ & < && 24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\ & = && 1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\ & \stackrel{n > 3}{\leq} && 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots \cdot n\\ & = && n! \end{aligned}

\begin{alignat*}{2}
2^n & =                      && \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{ times}}\\
& \stackrel{n > 3}{=}    && 2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      && 16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& <                      && 24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      && 1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& \stackrel{n > 3}{\leq} && 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots \cdot n\\
& =                      && n!
\end{alignat*}

\end{document}

The corresponding outputs have the following flaws:

• align:

The reduced space between the relation symbols and the terms they connect makes it harder to recognize the steps in this proof. While one can argue whether more space is a good thing here (I read "consistency over all" in one of the documents advocating the avoidance of eqnarray and I do not entirely agree on this - I think readability is more important than consistency while consistency supports readability in most cases but possibly not always), I think it is definitely not the best thing that the relations built with \stackrel are not aligned in a centered way below the other relation symbols. The latter point is also a flaw of all the other attempts to use an environment of the amsmath package (which is to be expected as these environments only offer columns being left- or right-aligned but not centered - at least I did not find a similar environment offering a centered column).

• aligned:

While we do have more space on the right of the relation symbols, we have less space on the left of them.

• alignat:

This is even worse than aligned since now the spacing is not only different between left and right of the relation symbols but we also have almost no space between the relation symbols built with \stackrel and the next term.

The second situation is the definition of substitutions as comma-separated lists of replacements in square brackets (a notation quite common in, e.g., term rewriting or logic programming). If these definitions are too long such that we need to break them, the environments of the amsmath package do not succeed in aligning the second line correctly while keeping the same amount of space left and right of the = symbol:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{eqnarray*}
\sigma & = & [x_1/t_1,x_2/t_2,\\
&   & x_3/t_3,x_4/t_4]
\end{eqnarray*}

\begin{align*}
\sigma & = [x_1/t_1,x_2/t_2,\\
&   x_3/t_3,x_4/t_4]
\end{align*}

\begin{align*}
\begin{split}
\sigma & = [x_1/t_1,x_2/t_2,\\
&   x_3/t_3,x_4/t_4]
\end{split}
\end{align*}

\begin{aligned} \sigma & = && [x_1/t_1,x_2/t_2,\\ & && x_3/t_3,x_4/t_4] \end{aligned}

\begin{alignat*}{2}
\sigma & = && [x_1/t_1,x_2/t_2,\\
&   && x_3/t_3,x_4/t_4]
\end{alignat*}

\end{document}

• eqnarray:

• align:

Here, the two versions with and without the use of split yield the same output. The spacing around = is consistent but the alignment of the second line is wrong.

• aligned:

Here, the alignment is ok, but the spacing is inconsistent.

• alignat:

Again, the alignment is ok but the spacing is inconsistent.

So my question is: How can these two situations be handled without using eqnarray yielding an output which is at least as readable as the versions using it and with a similar (or less) amount of code?

Of course, one can use array and customize it accordingly, but what would be the point of doing so in preference of using the existing eqnarray? Also, in Aligning a split up equation not at equal sign (which is similar to my second situation) the only answer suggests to use \phantom in combination with align to fix the alignment. While this is of course possible, it is definitely more tedious than using eqnarray in such a situation as described above.

• “Solving” the bad alignment with eqnarray is wrong anyway, because eqnarray must never be used: its output is bad and it doesn't cooperate well with some packages (notably hyperref and cleveref). – egreg Dec 30 '15 at 14:43
• @egreg Well, here I show a case where I consider the output with eqnarray better than that of align (at least in the form I tried to use it). My question is not to improve the output of the versions using eqnarray but to come up with alternatives that do not use it and yield an output which is at least as good. I understand that there are many problems with eqnarray but avoiding it just for the sake of avoiding it does not make sense to me. In these situations described here, I do not have any problems with hyperref or cleveref or whatsoever. – cryingshadow Dec 30 '15 at 14:48

The output of eqnarray is wrong anyway and there's little to do about it. Consider also that it doesn't work with cross-references if hyperref or cleveref are involved.

No, there's no reason for using it.

The first example can be dealt with using array:

\documentclass{article}

\usepackage{amsmath,array}

\begin{document}

\begin{equation*}
\renewcommand{\arraystretch}{1.5}
\begin{array}{@{} r @{} >{{}} c <{{}} @{} l @{} }
2^n
& =                   & \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{ times}}\\
& \overset{n>3}{=}    & 2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                   & 16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& <                   & 24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                   & 1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4 \text{ times}}\\
& \overset{n>3}{\leq} & 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots \cdot n\\
& =                   & n!
\end{array}
\end{equation*}

A better proof, by induction, is
\begin{alignat*}{2}
2^4     &= 16 < 4! = 24  \\
2^{n+1} &= 2\cdot 2^n    &\quad&\text{for $n>3$} \\
&< (n+1)\cdot n! \\
&= (n+1)!
\end{alignat*}
\end{document}

The second example is even easier: use a good alignment point:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
\sigma =[ &x_1/t_1,x_2/t_2,\\
& x_3/t_3,x_4/t_4]
\end{align*}

\end{document}

More lines can be accommodated:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
\sigma = [ &x_1/t_1,x_2/t_2, \\
& x_3/t_3,x_4/t_4] \\
\tau   = [ &y_1/t_1] \\
\psi   = [ &x_1/t_1,x_2/t_2,\\
& x_3/t_3,x_4/t_4]
\end{align*}

\end{document}

• @cryingshadow Look closely at the output, you'll see that the spacing is much better with array. About the second problem, I see no issue, I'll add the example. – egreg Dec 30 '15 at 15:23
• @cryingshadow I see no advantage whatsoever in using eqnarray. Do as you like. – egreg Dec 30 '15 at 16:06
• Compare the amount of code. There is definitely less code in the version using eqnarray compared to yours with array. I would consider the output in both versions more or less equally good. Don't get me wrong: I do not want to use eqnarray if there is an actual advantage in not doing so. But just changing a document to avoid the use of eqnarray if there is no advantage would mean work for nothing. So I'm asking what the advantage in avoiding eqnarray in favor of array is such that this change is justified. – cryingshadow Dec 30 '15 at 16:16
• @cryingshadow Don't get me wrong. I think that egreg already give you the best answer "Do as you like" so if you like eqnarray just use it and if you change your mind later, just change your code. – touhami Dec 30 '15 at 17:16
• @cryingshadow I tried to explain that eqnarray provides bad output, is buggy and incompatible with useful packages. If these are insufficient reasons for you, I don't know what else to say. – egreg Dec 30 '15 at 17:23

Use \mathclap:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begingroup
\advance\thickmuskip by 5mu  % 5mu = 5/18 em
\begin{align*}
2^n &=                      \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n \text{
times}}\\
& \stackrel{\mathclap{n > 3}}{=}    2 \cdot 2 \cdot 2 \cdot 2 \cdot \underbrace{2
\cdot 2 \cdot
\ldots \cdot 2}_{n - 4 \text{ times}}\\
& =                      16 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4
\text{ times}}\\
& <                      24 \cdot \underbrace{2 \cdot 2 \cdot \ldots \cdot 2}_{n - 4
\text{ times}}\\
& =                      1 \cdot 2 \cdot 3 \cdot 4 \cdot \underbrace{2 \cdot 2 \cdot
\ldots \cdot 2}_{n - 4 \text{ times}}\\
& \stackrel{\mathclap{n > 3}}{\leq} 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot \ldots
\cdot n\\
& =                      n!
\end{align*}
\endgroup

\end{document}

• What is the part \advance\thickmuskip by 5mu about? Is this generally applicable or tailored to the content above the relation symbols? – cryingshadow Dec 30 '15 at 16:20
• It is in mathmode the space left and right from the relation symbol =. 1mu=1/18 em – user2478 Dec 30 '15 at 16:42


text:
# Powersets II

## 1 What

In another article we introduced the power set or poset, which is the collection of all subsets of the set S, and provided one solution. In this article, we provide an alternative solution.

## 2 Why

The previous solution is straightforward and has good performance characteristics, but it does have the drawback of not taking advantage of the set theory nature of the problem and consequently losing a bit of elegance. This solution improves upon those metrics.

## 3 How

A simple recursive algorithm is available for generating the power set $$\mathscr{P}(S)$$ over the set $$S$$. Generate a series of sets of sets $$\mathscr{P}_i$$ according to the rule,

$\mathscr{P}_0 = \left\{\left\{\right\}\right\}$

$\mathscr{P}_i = \left\{ \forall Q_j \in \mathscr{P}_{i-1}, \forall s_k \in S: Q_j \cup \left\{s_k\right\} \right\}$

That's quite a mouthful of $$\LaTeX$$, and it may be unclear how our lives have been improved by it if at all. Let's break that down by translating it into English. This rule says that the first—or zeroeth—set $$\mathscr{P}_0$$ in the series just contains the empty set $$\left\{\right\}$$. It also says that every other set $$\mathscr{P}_i$$ each contains all the subsets formed by the union of every subset $$Q_j$$ in the previous set in the series $$\mathscr{P}_{i-1}$$ with every set $$\left\{s_k\right\}$$ taken over the set $$S$$.

Are you saying that still doesn't help? Perhaps another way to put it is as an algorithm:

1. Create a new empty list.
2. Add to that set a new empty list, so that you have a list of lists containing just one element, the empty list.
3. Loop over our list of lists and for each element $$l_i$$ (itself a list),
1. Loop over our list of original elements and for each element $$s_j$$
2. add that element $$s_j$$ to the list $$l_i$$.

Put this way, we have an algorithm that manipulates the list of lists in place. Since sets are generally regarded as immutable (though Python sets do not enforce this), for convenience we switch to simple lists in this algorithm.

Any way you try to explain it in words, it may very well be longer than the actual implementation, whose remarkable concision the reward. We define a single recursive function poset. Its input parameters are items, a set of elements over which we are computing the powerset, and pset, the powerset that has been generated so far. That warrants an explanation.

This function generates the powerset by taking the first element from items and adding it to every set in pset, and then recursively passing to the next function call the remaining elements along with the newly updated powerset. All that remains is to bootstrap the pset list by populating it with a seed set—the empty set—in the first invocation. That's handled easily in Python with a default argument for pset. Within the function, we use standard Python list slicing, list merging, list comprehensions, and the ternary operator to peel apart the items parameter, to compose the updated subsets, to iterate over the elements of items, and to handle the base case.

def poset(items, pset=[[]]):
return poset(items[1:], pset + [s + items[:1] for s in pset]) if items else pset

That works perfectly. However, for the sake of rigor once again we will adapt our Python lists using the Python frozenset, which is a bona-fide immutable set that can itself be added to other sets.

def poset(items, pset={frozenset({})}):
items = list(items)
pset = [list(s) for s in pset]
return poset(items[1:], pset + [s + items[:1] for s in pset]) if items else {frozenset(s) for s in pset}

Now, we're done! We can use our poset function to generate the power set for any modestly sized set.

print poset([1, 2, 3])

set([frozenset([3]), frozenset([1, 2]), frozenset([]), frozenset([2, 3]), frozenset([1]), frozenset([1, 3]), frozenset([1, 2, 3]), frozenset([2])])

That's not very readable, but if we sacrifice a little rigor by converting the sets back into lists it looks better.

sorted([list(p) for p in poset({1, 2, 3})], key=len)

[[], [3], [1], [2], [1, 2], [2, 3], [1, 3], [1, 2, 3]]

Like with the previous implementation, this was fun. Moreover, it is even more simple and concise. Personally, I think that it's downright elegant!


text:
### LEAP#205 Triac Dimmer

A triac is a "bidirectional thyristor" because it conducts in both directions and is typically used in AC applications.

The basic behaviour of a triac can be summarised in two rules:

• Rule 1. To turn ON, a gate current ≥ IGT must be applied until the load current is ≥ IL (latching current).
• Rule 2. To turn OFF (commutate), the load current must be < IH (holding current) for long enough for the device to return to the blocking state.

This project is a test of the classic AC dimmer circuit with Triacs with a 12V AC supply. It allows power to be dialed down by effectively chopping out part of each cycle. As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub.

### LittleArduinoProjects now with fancy catalog!

I keep finding new uses for GitHub Pages - situations where in the past I would otherwise have spun up a web site on heroku or similar. But if the site can be static, and especially if you are already hosting the git repository at GitHub, Pages are perfect.

For a long time, I've maintained the LittleArduinoProjects project index as a simple table in the README. But it wasn't particularly nice or usable, so I decided to pimp it up and serve the catalog index with pages. Turned out to be a piece of cake (with a few scripts to convert the old index to JSON for the catalog page.

So here it is, Little Electronics & Arduino Projects at leap.tardate.com:

As always - and since the gh-pages code lives in the same repo - all notes and code for the catalog are available in the same Little Electronics & Arduino Projects repo on GitHub.

### On "random" CI failures

I closed a bug yesterday that's been kicking around for almost a year as a sometimes fails on CI but no-one can figure out why frustration.

Sooner or later you'll hear someone suspect it must be a problem with CI. Which is ironically funny in a shoot-the-messenger kind of way!

Thankfully our "CI issue" turned into a for-real bug. In short, the code involved many classes with near 100% test coverage. It had been read and re-read and everyone would swear there's no way this could fail.

No, of course we were wrong. The bug was basically a conspiracy of two bits of code in two very different places:

• a record validation that ensured field1 was not the same as field2
• a data collection routine that could be configured to filter/replace sensitive values with a random ** string: ["*" * rand(4..10)]

And you can see where this leads: our problem was filtered data ending up by obscure and circuitous means in field1 and field2 ... with a 1 in 7 chance of the record validation failing (never happens on our machines of course). After that it was an easy fix.

So once again we learn the lesson:
If CI say red but we can't figure out why, "must be a problem with CI" is 99.999% the wrong answer. It just means we haven't found the bug yet.

I've seen this scenario play out a dozen times in as many years, and CI was always right;-) Since it keeps cropping up, it made me think about how to best knock these on the head. Five things:

#### start by assuming there is a bug until proven otherwise

It's too easy to give up, find scape-goats or "magic" explanations otherwise.
Take heart in the fact that if you assume CI is right, the odds are on your side.

#### put a canary in a coalmine

When we first encountered this issue and failed to find the root cause, we added code to catch the "this is about to fail in that unexpected way" situation and log/report appropriately.

So while the ticket got iced, it's been that "canary" that keeps dying in order to keep the issue alive! So when it died again yesterday, it was a painful reminder to get to the bottom of the issue once and for all.

#### finding bugs .. is like looking for your keys

Always found in the last place to look. So when you've honed in on the code you think is failing, studied it upside down, left to right, and still can't find the issue .. maybe it's time to consider you might be right. Throw out that hypothesis, pull back and fan out instead.

#### treat random errors like a lottery

If errors happen infrequently, reproducing them is like trying to win the lottery. The more entries, the better your chances.

So don't run tests a few times, run them millions of times if you have to. Computers are good at this. That's how I diagnosed this latest issue while tweaking logging and the test itself. Bash away:
for (( ; ; )) ; do  rspec spec/that_wierd_spec.rb   if [ \$? == 1 ]   then     echo "JACKPOT!"     break   fi done

#### random failures ... might really be random

This sounds so simple that it's easy to overlook.

If things fail randomly .. it only takes a few moments to search the code to see if anything is using something similar to a random function.

Could it be possible that random failures and the use of rand() might be related?!
May be not, but if they are, that's a cheap win!


text:
# What exactly is the weak portion of the SM gauge group?

This Wikipedia article: http://en.wikipedia.org/wiki/Left%E2%80%93right_symmetry states that the weak part of the SM gauge group is not $SU(2)_L \times U(1)_Y$ but $\frac{ SU(2)_L \times U(1)_Y}{\bf{Z}_2}$. If this is correct, what is the significance of the $\bf{Z}_2$ ?

-

While the question is based on physics, the answer is almost entirely pure math. If you've had a course on group theory (and I highly recommend taking one in the math department in addition to whatever has been mentioned in physics classes), you'll recognize this as taking the quotient of the original group by $\mathbb{Z}_2$. What that means is we started with our original symmetry group $SU(2)_\mathrm{L} \times U(1)_\mathrm{Y}$, which I'll call $G$, and found a normal subgroup within it isomorphic to $\mathbb{Z}_2$.

At this point we say that we want to identify one of the nontrivial symmetries with the identity as a single, cohesive unit. What does this do to the rest of the group? Well, we want to preserve as much of the group structure as possible, and so we pair off all the other elements in $G$ in the same way. Each of these pairs is a coset. The set of cosets inherits its group structure from $G$, and we call this new group the quotient group $G/\mathbb{Z}_2$. In the case of finite groups where cardinality has meaning, we note that $$\lvert G/\mathbb{Z}_2 \rvert = \frac{\lvert G \rvert}{\lvert \mathbb{Z}_2 \rvert} = \frac{\lvert G \rvert}{2}.$$

-

The weak part of the standard model gauge group is SU(2)xU(1), but you need to check that every one of these gauge transformations acts on the fields nontrivially. If one of these transformations does nothing to the standard model fields, then you can consider this gauge tranformation to be identified with the identity.

The only elements of SU(2) you can identify with the identity is the one corresponding to a rotation by 360 degrees, since only this one commutes with everything else. In SU(2), the 360 degree rotation is the 2 by 2 matrix -1, and since there are weak doublets, these are like spin-fermions, they get negated by this transformation. But you also have a U(1), so you need to undo the negation by an appropriate U(1) transformation in order to keep the fields the same. If you can do this for all the fields in the standard model, then you can say that the true gauge group is SU(2)xU(1)/Z_2.

The Higgs and lepton doublets are all SU(2) doublet with U(1) charge 1/2, so you need to do a 360 degree SU(2) rotation, and a U(1) rotation by angle $2\pi n$ where n is an odd integer, so that 1/2 times $2\pi n$ is $\pi n$ and gives you a -1 phase.

The right handed lepton has charge 1, so it is invariant under the $2\pi n$. This means the pure lepton sector is invariant.

The left handed quark doublet is has charge 1/6, so in order to be invariant, you need n to be a multiple of 3, which means n=3, and the U(1) rotation is by $6\pi$.

The right handed quarks have U(1) charge 2/3 and -1/3, so they get a phase of $4\pi$ and $2\pi$ from the rotation, or nothing at all.

So the $Z_2$ Wikipedia is talking about does a 360 degree rotation on the doublet fields (it changes their sign) and then does a half-turn in the U(1), so that the 1/6 and 1/2 fields change sign, but the charge 1,1/3,2/3 fields do not. This transformation keeps all the fields the same, so it is consistent to say that the standard model gauge group is reduced by this symmetry.

-
Ron, are there repercussions about being sloppy about this factor of $\bf{Z}_2$? That is, if I plod along ignorantly calculating SM cross sections and decay rates what is the result of ignoring this? –  DJBunk Mar 15 at 21:18
Not for SM perturbative cross sections--- these are unaffected by the global gauge group--- they don't see the large field configurations at all, the SU(2) fields are near the identity all the time. You would only change the allowed representations, the monopole spectrum and the instanton configurations. There might be a way to discriminate between different gauge groups in a confining theory, where the long distance gauge configurations would be reduced in the quotient groups, I don't know, I'll have to think about it. –  Ron Maimon Mar 16 at 1:09


text:
Statistics
| Branch: | Revision:

## iof-tools / networkxMiCe / networkx-master / networkx / algorithms / connectivity / cuts.py @ 5cef0f13

History | View | Annotate | Download (22.5 KB)

 1 # -*- coding: utf-8 -*-  """  Flow based cut algorithms  """  import itertools  import networkx as nx  # Define the default maximum flow function to use in all flow based  # cut algorithms.  from networkx.algorithms.flow import edmonds_karp  from networkx.algorithms.flow import build_residual_network  default_flow_func = edmonds_karp  from .utils import (build_auxiliary_node_connectivity,   build_auxiliary_edge_connectivity)  __author__ = '\n'.join(['Jordi Torrents '])  __all__ = ['minimum_st_node_cut',   'minimum_node_cut',   'minimum_st_edge_cut',   'minimum_edge_cut']  def minimum_st_edge_cut(G, s, t, flow_func=None, auxiliary=None,   residual=None):   """Returns the edges of the cut-set of a minimum (s, t)-cut.     This function returns the set of edges of minimum cardinality that,   if removed, would destroy all paths among source and target in G.   Edge weights are not considered. See :meth:minimum_cut for   computing minimum cuts considering edge weights.     Parameters   ----------   G : NetworkX graph     s : node   Source node for the flow.     t : node   Sink node for the flow.     auxiliary : NetworkX DiGraph   Auxiliary digraph to compute flow based node connectivity. It has   to have a graph attribute called mapping with a dictionary mapping   node names in G and in the auxiliary digraph. If provided   it will be reused instead of recreated. Default value: None.     flow_func : function   A function for computing the maximum flow among a pair of nodes.   The function has to accept at least three parameters: a Digraph,   a source node, and a target node. And return a residual network   that follows NetworkX conventions (see :meth:maximum_flow for   details). If flow_func is None, the default maximum flow function   (:meth:edmonds_karp) is used. See :meth:node_connectivity for   details. The choice of the default function may change from version   to version and should not be relied on. Default value: None.     residual : NetworkX DiGraph   Residual network to compute maximum flow. If provided it will be   reused instead of recreated. Default value: None.     Returns   -------   cutset : set   Set of edges that, if removed from the graph, will disconnect it.     See also   --------   :meth:minimum_cut   :meth:minimum_node_cut   :meth:minimum_edge_cut   :meth:stoer_wagner   :meth:node_connectivity   :meth:edge_connectivity   :meth:maximum_flow   :meth:edmonds_karp   :meth:preflow_push   :meth:shortest_augmenting_path     Examples   --------   This function is not imported in the base NetworkX namespace, so you   have to explicitly import it from the connectivity package:     >>> from networkx.algorithms.connectivity import minimum_st_edge_cut     We use in this example the platonic icosahedral graph, which has edge   connectivity 5.     >>> G = nx.icosahedral_graph()   >>> len(minimum_st_edge_cut(G, 0, 6))   5     If you need to compute local edge cuts on several pairs of   nodes in the same graph, it is recommended that you reuse the   data structures that NetworkX uses in the computation: the   auxiliary digraph for edge connectivity, and the residual   network for the underlying maximum flow computation.     Example of how to compute local edge cuts among all pairs of   nodes of the platonic icosahedral graph reusing the data   structures.     >>> import itertools   >>> # You also have to explicitly import the function for   >>> # building the auxiliary digraph from the connectivity package   >>> from networkx.algorithms.connectivity import (   ... build_auxiliary_edge_connectivity)   >>> H = build_auxiliary_edge_connectivity(G)   >>> # And the function for building the residual network from the   >>> # flow package   >>> from networkx.algorithms.flow import build_residual_network   >>> # Note that the auxiliary digraph has an edge attribute named capacity   >>> R = build_residual_network(H, 'capacity')   >>> result = dict.fromkeys(G, dict())   >>> # Reuse the auxiliary digraph and the residual network by passing them   >>> # as parameters   >>> for u, v in itertools.combinations(G, 2):   ... k = len(minimum_st_edge_cut(G, u, v, auxiliary=H, residual=R))   ... result[u][v] = k   >>> all(result[u][v] == 5 for u, v in itertools.combinations(G, 2))   True     You can also use alternative flow algorithms for computing edge   cuts. For instance, in dense networks the algorithm   :meth:shortest_augmenting_path will usually perform better than   the default :meth:edmonds_karp which is faster for sparse   networks with highly skewed degree distributions. Alternative flow   functions have to be explicitly imported from the flow package.     >>> from networkx.algorithms.flow import shortest_augmenting_path   >>> len(minimum_st_edge_cut(G, 0, 6, flow_func=shortest_augmenting_path))   5     """   if flow_func is None:   flow_func = default_flow_func   if auxiliary is None:   H = build_auxiliary_edge_connectivity(G)   else:   H = auxiliary   kwargs = dict(capacity='capacity', flow_func=flow_func, residual=residual)   cut_value, partition = nx.minimum_cut(H, s, t, **kwargs)   reachable, non_reachable = partition   # Any edge in the original graph linking the two sets in the   # partition is part of the edge cutset   cutset = set()   for u, nbrs in ((n, G[n]) for n in reachable):   cutset.update((u, v) for v in nbrs if v in non_reachable)   return cutset  def minimum_st_node_cut(G, s, t, flow_func=None, auxiliary=None, residual=None):   r"""Returns a set of nodes of minimum cardinality that disconnect source   from target in G.     This function returns the set of nodes of minimum cardinality that,   if removed, would destroy all paths among source and target in G.     Parameters   ----------   G : NetworkX graph     s : node   Source node.     t : node   Target node.     flow_func : function   A function for computing the maximum flow among a pair of nodes.   The function has to accept at least three parameters: a Digraph,   a source node, and a target node. And return a residual network   that follows NetworkX conventions (see :meth:maximum_flow for   details). If flow_func is None, the default maximum flow function   (:meth:edmonds_karp) is used. See below for details. The choice   of the default function may change from version to version and   should not be relied on. Default value: None.     auxiliary : NetworkX DiGraph   Auxiliary digraph to compute flow based node connectivity. It has   to have a graph attribute called mapping with a dictionary mapping   node names in G and in the auxiliary digraph. If provided   it will be reused instead of recreated. Default value: None.     residual : NetworkX DiGraph   Residual network to compute maximum flow. If provided it will be   reused instead of recreated. Default value: None.     Returns   -------   cutset : set   Set of nodes that, if removed, would destroy all paths between   source and target in G.     Examples   --------   This function is not imported in the base NetworkX namespace, so you   have to explicitly import it from the connectivity package:     >>> from networkx.algorithms.connectivity import minimum_st_node_cut     We use in this example the platonic icosahedral graph, which has node   connectivity 5.     >>> G = nx.icosahedral_graph()   >>> len(minimum_st_node_cut(G, 0, 6))   5     If you need to compute local st cuts between several pairs of   nodes in the same graph, it is recommended that you reuse the   data structures that NetworkX uses in the computation: the   auxiliary digraph for node connectivity and node cuts, and the   residual network for the underlying maximum flow computation.     Example of how to compute local st node cuts reusing the data   structures:     >>> # You also have to explicitly import the function for   >>> # building the auxiliary digraph from the connectivity package   >>> from networkx.algorithms.connectivity import (   ... build_auxiliary_node_connectivity)   >>> H = build_auxiliary_node_connectivity(G)   >>> # And the function for building the residual network from the   >>> # flow package   >>> from networkx.algorithms.flow import build_residual_network   >>> # Note that the auxiliary digraph has an edge attribute named capacity   >>> R = build_residual_network(H, 'capacity')   >>> # Reuse the auxiliary digraph and the residual network by passing them   >>> # as parameters   >>> len(minimum_st_node_cut(G, 0, 6, auxiliary=H, residual=R))   5     You can also use alternative flow algorithms for computing minimum st   node cuts. For instance, in dense networks the algorithm   :meth:shortest_augmenting_path will usually perform better than   the default :meth:edmonds_karp which is faster for sparse   networks with highly skewed degree distributions. Alternative flow   functions have to be explicitly imported from the flow package.     >>> from networkx.algorithms.flow import shortest_augmenting_path   >>> len(minimum_st_node_cut(G, 0, 6, flow_func=shortest_augmenting_path))   5     Notes   -----   This is a flow based implementation of minimum node cut. The algorithm   is based in solving a number of maximum flow computations to determine   the capacity of the minimum cut on an auxiliary directed network that   corresponds to the minimum node cut of G. It handles both directed   and undirected graphs. This implementation is based on algorithm 11   in [1]_.     See also   --------   :meth:minimum_node_cut   :meth:minimum_edge_cut   :meth:stoer_wagner   :meth:node_connectivity   :meth:edge_connectivity   :meth:maximum_flow   :meth:edmonds_karp   :meth:preflow_push   :meth:shortest_augmenting_path     References   ----------   .. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.   http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf     """   if auxiliary is None:   H = build_auxiliary_node_connectivity(G)   else:   H = auxiliary   mapping = H.graph.get('mapping', None)   if mapping is None:   raise nx.NetworkXError('Invalid auxiliary digraph.')   if G.has_edge(s, t) or G.has_edge(t, s):   return []   kwargs = dict(flow_func=flow_func, residual=residual, auxiliary=H)   # The edge cut in the auxiliary digraph corresponds to the node cut in the   # original graph.   edge_cut = minimum_st_edge_cut(H, '%sB' % mapping[s], '%sA' % mapping[t],   **kwargs)   # Each node in the original graph maps to two nodes of the auxiliary graph   node_cut = set(H.nodes[node]['id'] for edge in edge_cut for node in edge)   return node_cut - set([s, t])  def minimum_node_cut(G, s=None, t=None, flow_func=None):   r"""Returns a set of nodes of minimum cardinality that disconnects G.     If source and target nodes are provided, this function returns the   set of nodes of minimum cardinality that, if removed, would destroy   all paths among source and target in G. If not, it returns a set   of nodes of minimum cardinality that disconnects G.     Parameters   ----------   G : NetworkX graph     s : node   Source node. Optional. Default value: None.     t : node   Target node. Optional. Default value: None.     flow_func : function   A function for computing the maximum flow among a pair of nodes.   The function has to accept at least three parameters: a Digraph,   a source node, and a target node. And return a residual network   that follows NetworkX conventions (see :meth:maximum_flow for   details). If flow_func is None, the default maximum flow function   (:meth:edmonds_karp) is used. See below for details. The   choice of the default function may change from version   to version and should not be relied on. Default value: None.     Returns   -------   cutset : set   Set of nodes that, if removed, would disconnect G. If source   and target nodes are provided, the set contains the nodes that   if removed, would destroy all paths between source and target.     Examples   --------   >>> # Platonic icosahedral graph has node connectivity 5   >>> G = nx.icosahedral_graph()   >>> node_cut = nx.minimum_node_cut(G)   >>> len(node_cut)   5     You can use alternative flow algorithms for the underlying maximum   flow computation. In dense networks the algorithm   :meth:shortest_augmenting_path will usually perform better   than the default :meth:edmonds_karp, which is faster for   sparse networks with highly skewed degree distributions. Alternative   flow functions have to be explicitly imported from the flow package.     >>> from networkx.algorithms.flow import shortest_augmenting_path   >>> node_cut == nx.minimum_node_cut(G, flow_func=shortest_augmenting_path)   True     If you specify a pair of nodes (source and target) as parameters,   this function returns a local st node cut.     >>> len(nx.minimum_node_cut(G, 3, 7))   5     If you need to perform several local st cuts among different   pairs of nodes on the same graph, it is recommended that you reuse   the data structures used in the maximum flow computations. See   :meth:minimum_st_node_cut for details.     Notes   -----   This is a flow based implementation of minimum node cut. The algorithm   is based in solving a number of maximum flow computations to determine   the capacity of the minimum cut on an auxiliary directed network that   corresponds to the minimum node cut of G. It handles both directed   and undirected graphs. This implementation is based on algorithm 11   in [1]_.     See also   --------   :meth:minimum_st_node_cut   :meth:minimum_cut   :meth:minimum_edge_cut   :meth:stoer_wagner   :meth:node_connectivity   :meth:edge_connectivity   :meth:maximum_flow   :meth:edmonds_karp   :meth:preflow_push   :meth:shortest_augmenting_path     References   ----------   .. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.   http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf     """   if (s is not None and t is None) or (s is None and t is not None):   raise nx.NetworkXError('Both source and target must be specified.')   # Local minimum node cut.   if s is not None and t is not None:   if s not in G:   raise nx.NetworkXError('node %s not in graph' % s)   if t not in G:   raise nx.NetworkXError('node %s not in graph' % t)   return minimum_st_node_cut(G, s, t, flow_func=flow_func)   # Global minimum node cut.   # Analog to the algorithm 11 for global node connectivity in [1].   if G.is_directed():   if not nx.is_weakly_connected(G):   raise nx.NetworkXError('Input graph is not connected')   iter_func = itertools.permutations   def neighbors(v):   return itertools.chain.from_iterable([G.predecessors(v),   G.successors(v)])   else:   if not nx.is_connected(G):   raise nx.NetworkXError('Input graph is not connected')   iter_func = itertools.combinations   neighbors = G.neighbors   # Reuse the auxiliary digraph and the residual network.   H = build_auxiliary_node_connectivity(G)   R = build_residual_network(H, 'capacity')   kwargs = dict(flow_func=flow_func, auxiliary=H, residual=R)   # Choose a node with minimum degree.   v = min(G, key=G.degree)   # Initial node cutset is all neighbors of the node with minimum degree.   min_cut = set(G[v])   # Compute st node cuts between v and all its non-neighbors nodes in G.   for w in set(G) - set(neighbors(v)) - set([v]):   this_cut = minimum_st_node_cut(G, v, w, **kwargs)   if len(min_cut) >= len(this_cut):   min_cut = this_cut   # Also for non adjacent pairs of neighbors of v.   for x, y in iter_func(neighbors(v), 2):   if y in G[x]:   continue   this_cut = minimum_st_node_cut(G, x, y, **kwargs)   if len(min_cut) >= len(this_cut):   min_cut = this_cut   return min_cut  def minimum_edge_cut(G, s=None, t=None, flow_func=None):   r"""Returns a set of edges of minimum cardinality that disconnects G.     If source and target nodes are provided, this function returns the   set of edges of minimum cardinality that, if removed, would break   all paths among source and target in G. If not, it returns a set of   edges of minimum cardinality that disconnects G.     Parameters   ----------   G : NetworkX graph     s : node   Source node. Optional. Default value: None.     t : node   Target node. Optional. Default value: None.     flow_func : function   A function for computing the maximum flow among a pair of nodes.   The function has to accept at least three parameters: a Digraph,   a source node, and a target node. And return a residual network   that follows NetworkX conventions (see :meth:maximum_flow for   details). If flow_func is None, the default maximum flow function   (:meth:edmonds_karp) is used. See below for details. The   choice of the default function may change from version   to version and should not be relied on. Default value: None.     Returns   -------   cutset : set   Set of edges that, if removed, would disconnect G. If source   and target nodes are provided, the set contains the edges that   if removed, would destroy all paths between source and target.     Examples   --------   >>> # Platonic icosahedral graph has edge connectivity 5   >>> G = nx.icosahedral_graph()   >>> len(nx.minimum_edge_cut(G))   5     You can use alternative flow algorithms for the underlying   maximum flow computation. In dense networks the algorithm   :meth:shortest_augmenting_path will usually perform better   than the default :meth:edmonds_karp, which is faster for   sparse networks with highly skewed degree distributions.   Alternative flow functions have to be explicitly imported   from the flow package.     >>> from networkx.algorithms.flow import shortest_augmenting_path   >>> len(nx.minimum_edge_cut(G, flow_func=shortest_augmenting_path))   5     If you specify a pair of nodes (source and target) as parameters,   this function returns the value of local edge connectivity.     >>> nx.edge_connectivity(G, 3, 7)   5     If you need to perform several local computations among different   pairs of nodes on the same graph, it is recommended that you reuse   the data structures used in the maximum flow computations. See   :meth:local_edge_connectivity for details.     Notes   -----   This is a flow based implementation of minimum edge cut. For   undirected graphs the algorithm works by finding a 'small' dominating   set of nodes of G (see algorithm 7 in [1]_) and computing the maximum   flow between an arbitrary node in the dominating set and the rest of   nodes in it. This is an implementation of algorithm 6 in [1]_. For   directed graphs, the algorithm does n calls to the max flow function.   The function raises an error if the directed graph is not weakly   connected and returns an empty set if it is weakly connected.   It is an implementation of algorithm 8 in [1]_.     See also   --------   :meth:minimum_st_edge_cut   :meth:minimum_node_cut   :meth:stoer_wagner   :meth:node_connectivity   :meth:edge_connectivity   :meth:maximum_flow   :meth:edmonds_karp   :meth:preflow_push   :meth:shortest_augmenting_path     References   ----------   .. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.   http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf     """   if (s is not None and t is None) or (s is None and t is not None):   raise nx.NetworkXError('Both source and target must be specified.')   # reuse auxiliary digraph and residual network   H = build_auxiliary_edge_connectivity(G)   R = build_residual_network(H, 'capacity')   kwargs = dict(flow_func=flow_func, residual=R, auxiliary=H)   # Local minimum edge cut if s and t are not None   if s is not None and t is not None:   if s not in G:   raise nx.NetworkXError('node %s not in graph' % s)   if t not in G:   raise nx.NetworkXError('node %s not in graph' % t)   return minimum_st_edge_cut(H, s, t, **kwargs)   # Global minimum edge cut   # Analog to the algorithm for global edge connectivity   if G.is_directed():   # Based on algorithm 8 in [1]   if not nx.is_weakly_connected(G):   raise nx.NetworkXError('Input graph is not connected')   # Initial cutset is all edges of a node with minimum degree   node = min(G, key=G.degree)   min_cut = set(G.edges(node))   nodes = list(G)   n = len(nodes)   for i in range(n):   try:   this_cut = minimum_st_edge_cut(H, nodes[i], nodes[i + 1], **kwargs)   if len(this_cut) <= len(min_cut):   min_cut = this_cut   except IndexError: # Last node!   this_cut = minimum_st_edge_cut(H, nodes[i], nodes[0], **kwargs)   if len(this_cut) <= len(min_cut):   min_cut = this_cut   return min_cut   else: # undirected   # Based on algorithm 6 in [1]   if not nx.is_connected(G):   raise nx.NetworkXError('Input graph is not connected')   # Initial cutset is all edges of a node with minimum degree   node = min(G, key=G.degree)   min_cut = set(G.edges(node))   # A dominating set is \lambda-covering   # We need a dominating set with at least two nodes   for node in G:   D = nx.dominating_set(G, start_with=node)   v = D.pop()   if D:   break   else:   # in complete graphs the dominating set will always be of one node   # thus we return min_cut, which now contains the edges of a node   # with minimum degree   return min_cut   for w in D:   this_cut = minimum_st_edge_cut(H, v, w, **kwargs)   if len(this_cut) <= len(min_cut):   min_cut = this_cut   return min_cut


text:
# Secrecy in Mathematics

I've been told that Pythagoreans kept as a secret the incommensurability of certain quantities like the diagonal of the square. Are there other mathematical discoveries whose authors didn't want the public to learn or know about?

• Most famous relatively recent example is Wiles' lectures in Princeton on his proof of Shimura-Tanoyama conjecture, without explaining what was he actually proving. See here. Jul 3 at 12:02
• @MoisheKohan didn't Newton keep calculus "under wraps" or is that mostly apocryphal? Jul 4 at 2:13
• @BruceWayne: As far as I know, yes, but this might be a misinformation. In the comment, I was going after a most recent example In know in pure math. Jul 4 at 3:04
• Perhaps not so much secrecy in knowledge, but we have William Sealy Goset that hid his identity under the pseudonym student to publish his results with anonymity. Jul 5 at 0:56
• youtube.com/watch?v=cUzklzVXJwo According to this video, mathematicians used to challenge each other to problem-solving "duels", with the winner taking the loser's job (!) Knowing more than your opponent was a big advantage, so yes, there was a lot of incentive to keep discoveries secret. Jul 6 at 1:03

In antiquity Archimedes kept his method of mechanical theorems about areas and volumes secret because, under Plato's influence, using lowly mechanics in glorious geometry was frowned upon at the time. The method is revealed in his letter to Eratosthenes, "for some things that first became clear to me by means of mechanics were afterwards demonstrated by means of geometry". In On Spirals he mentions sending false "theorems" to Alexandrians to prevent them from passing his as their own, "so that those who claim to discover everything, but produce no proofs of the same, may be confuted as having pretended to discover the impossible".

In 16th century del Ferro and Tartaglia kept their solutions to the cubic secret, also for priority reasons and to win current at the time mathematical duels that conveyed status and money. In fact, Tartaglia rediscovered the solution independently, after learning that del Ferro knew it, and then generalized it, which allowed him to beat Fiore, del Ferro's student, in one of those duels. It was knowing that the solution exists that gave the determination to find it, he wrote.

Many 17th century authors would cipher their results to claim priority and prevent others from taking advantage of them before they could. Newton famously sent an anagram to Leibniz, which expressed the idea of solving differential equations using calculus.

With the advancement of publish or perish these sorts of practices went away. Publishing is relatively quick and people usually only hold off until the publication, if that.

But other reasons came up. Babbage (the inventor of computers) discovered a statistical method for breaking Vigenere ciphers in 1846. It was kept secret because British intelligence was using it to read ciphered diplomatic correspondence, see Mr. Babbage's Secret. The method was rediscovered and published by Kasiski in 1863.

The story repeated itself in the 20th century. The first public key cryptosystem was developed by Cocks in 1973, also for British intelligence. It was only declassified in 1997. But already in 1977 Rivest, Shamir and Adleman published an equivalent now named after them, RSA.

Hamming discovered his error-correcting codes in 1948, but did not publish until 1950 because he was waiting for the patent to be approved. By that time, Golay rediscovered them and published, which led to a priority dispute, see Thompson, From Error-Correcting Codes Through Sphere Packings to Simple Groups.

A different type of secrecy emerged in the academia, especially within so-called schools, usually created and led by a single prominent mathematician. It concerns not so much results as intuitions, hunches, promising problems and conjectures, heuristics, informal tricks, etc., that are not so readily sharable in published form. Those, as Arnold put it "like parables, are only explained to the own disciples in private".

In this vein, there was a bizarre episode involving Kolmogorov. At his seminar in 1960 he explained his so-called $$n^2$$ conjecture, then standing for several years. A week later Karatsuba, a young walk-in, disproved it and told him. After reporting the finding Kolmogorov shut down the seminar. Two years later he published the result and credited it to Karatsuba, but without not only his permission but even knowledge, and bundled with results of his own student, see Was Kolmogorov enraged after learning about the Karatsuba multiplication algorithm? One possible explanation is that Kolmogorov originally misjudged the nature of the work in progress he was sharing. It was more immediately doable than he thought, and, per Arnold's maxim, only to be "explained to the own disciples in private".

To summarize, secrecy does not work for long, the results are soon rediscovered by others.

• Good set of examples. Except, I don't think there is any evidence that Archimedes kept his mechanical method secret. He does not consider it as rigorous proof (and indeed you need calculus to make it rigor). This was a reason why he tried to avoid it. And the fact that he wrote about this method in form of letter does not mean that it was secret. It's just a popular form of rhetoric. Many ancient works were written in epistle genre. E.g. Archimedes' Sand Reckoner or the Gospel of Luke. Jul 3 at 16:58
• The intrigue surrounding the solution to the cubic is a great story. There's a youtube video on the Veritasium channel that covers it: youtube.com/watch?v=cUzklzVXJwo Jul 5 at 13:30
• "With the advancement of publish or perish these sorts of practices went away" - only in "academics". I.e. it's an open secret that all kinds of government agencies can be years or even decades ahead of published works in terms of cryptography (which allows them to "insert" hidden backdoors in the accepted ciphers or protect them from yet undiscovered attacks instead) Jul 5 at 17:16

Sometimes, secret information has been deposited with a trusted organization.

Example.

In 1915, the Académie des Sciences in Paris gave the topic for its 1918 Grand Prix. The prize would be awarded for a study of iteration from a global point of view.

During the later half of 1917 Gaston Julia deposited his results in sealed envelopes with the Académie des Sciences.

Pierre Fatou, on the other hand, published an announcement of his results in the December 1917 part of Comptes Rendus. It later became evident that they had discovered very similar results. Julia requested that his sealed envelopes be opened: they proved that he had the priority. As a result, Fatou did not enter for the Grand Prix and it was awarded to Julia.

Whether Julia or Fatou deserves the credit of having priority matters little since their work was certainly totally independent.

reference: MacTutor

Another possible example is Rejewski's foundational work on Enigma, encompassing rather deep group-theoretic results. Unsurprisingly, cryptography leans towards secrecy.

On a different line there's Gauss' work on non-Euclidean geometries. He wrote about his decision "not to allow it to become known during my lifetime. Most people have not the insight to understand our conclusions and I have encountered only a few who received with any particular interest what I communicated to them. In order to understand these things, one must first have a keen perception of what is needed, and upon this point the majority are quite confused. On the other hand it was my plan to put all down on paper eventually ... ."

Pythagoras discovered the scale on which all music is based.

He also discovered that this scale fits into the pentagram, which symbolizes a mathematical law found through out nature, also known as the fibonacci sequence, or the "Golden Section".

Recent artists recaptured this secret, you can find the proportions of the golden ratio when you measure the facial proportions of the mona lisa for example.

As for secrecy, it is more about preservation.

The moment you define something it becomes a double-edged blade, because that thing is now debatable by a mass public, which may change the meaning of what you defined entirely.

True knowledge is pre-symbol.

It is not so much a secret as a result of people seeing the symbols they come up with also exist "out there" and from that both of these can conclude they both reached the same conclusions and they both know it.

A lot of conspiracy theories and misunderstandings arise out of this, when people think the prevalence of the pyramid with the eye is evidence of an organized group.

But that is not how it happens at all, it happens in an entirely opposite way.

• This answer sounds kind of mystical and not entirely coherent or answering the original question. Jul 5 at 14:44
• Any link between the Pythagorean scale (which does not include factors of 5, so not all music) and the pentagram is tenuous at best. Jul 8 at 18:02


text:
# Math olympics problem

1. Mar 6, 2010

### Someone1348

1. The problem statement, all variables and given/known data
I had this problem on the national math olympics of my country yesterday, I couldn't solve it... Knowing that the first statement is true, calculate the value of the second equation.

2. Relevant equations
$$\frac{a}{b+c+d}$$+$$\frac{b}{c+d+a}$$+$$\frac{c}{a+b+d}$$+$$\frac{d}{a+b+c}$$=1

Calculate the value of

$$\frac{a^2}{b+c+d}$$+$$\frac{b^2}{c+d+a}$$+$$\frac{c^2}{a+b+d}$$+$$\frac{d^2}{a+b+c}$$

3. The attempt at a solution

I lost a lot of time in this problem. I first tried to make one single, although huge, fraction of it, yet it didn't seem to simplify itself just to one value. Any better ways to approach this?

By the way, please excuse me if I posted this on the wrong forum, I just found this website and am still getting used to it. Also, since it isn't my homework or something I have to eventually give as homework, it doesn't matter if you show me directly the answer... I just posted it on this forum because it somewhat looked like the right one.

Last edited: Mar 6, 2010
2. Mar 6, 2010

### Mentallic

Caculate the following:

$$\frac{a+b+c+d}{a+b+c+d}\left(\frac{a}{b+c+d}+\frac{b}{a+c+d}+\frac{c}{a+b+d}+\frac{d}{a+b+c}\right)=1$$


text:
# Chapter 12 From the 3-equation of the new consensus to the post-Keynesian model

We can now make step-by-step changes to the NCM 3-equation model that we have studied in the previous chapter. Our aim is to show that relative small changes to the assumptions of the 3-equation model lead to substantial changes in the policy implications. The full combination of the changed set of assumptions will generate a simple and alternative macroeconomic model in line with post-Keynesian theory allowing for a different set of policy suggestions.

The main features of post-Keynesian macroeconomics can be summarised in the following list:44

• focus on a monetary theory of production according to which money is not neutral neither in the short nor in the long-run
• relevance of the principle of effective demand both in the short-run and in the long-run
• importance of the concept of fundamental uncertainty
• economic processes occur in historical, irreversible time and are largely path-dependent
• the distributional conflict plays a major role in determining economic outcomes

It follows that in post-Keynesian theory, the long-run equilibrium, i.e. the NAIRU and the corresponding inflation-stable employment level, is not independent from the demand side of the economy. In the following sections, we will look first at the various channels through which the NAIRU can be influenced by demand side factors and later, at how monetary, fiscal and wage/income policy, by affecting aggregate demand, can in turn influence the NAIRU.

## 12.1 Endogeneity of the NAIRU 1: labour market hysteresis

A first channel that makes the NAIRU dependent on actual unemployment and on macroeconomic policy is represented by the so-called hysteresis effect in the labour market. The hysteresis effect is a significant slowdown in the adjustment of the unemployment rate towards the NAIRU. High unemployment rates experienced during the transition phase towards the NAIRU after an initial demand shock may discourage parts of the workforce from actively looking for employment. These peculiar circumstances might have the effect that part of the workforce that has been long-term unemployed may end up exiting the labour market. This will improve the bargaining position of those who remain employed with the ultimate effect of increasing the NAIRU.

The idea of labour market hysteresis has been discussed by new Keynesian authors in the past and has been the subject of some more recent studies, Ball (2014) and Stockhammer and Sturn (2011). These authors argued that high unemployment rates end up having an increasing effect on the NAIRU and that unemployment determined by effective demand has an impact on the NAIRU and on the inflation-stable employment level. This bring us to the conclusion that monetary policy aimed at bringing the economy back to potential after a shock might have an effect on the long-run equilibrium of the model contradicting the assumption that sees monetary policy being neutral in the long run. Post-Keynesian authors argue that the opposite would also be true. If unemployment remains below the NAIRU for a long time, the NAIRU may end up decreasing (see, e.g. Hein and Stockhammer 2009). In this case, it can be assumed that previously discouraged workers would now be encouraged to actively participate to the job search with the effect of increasing competition in the labour market and decreasing the wage demands of the workers already employed. As the workforce increases, the NAIRU decreases. In the post-Keynesian model framework, the effect of demand on the NAIRU applies to both negative and positive movements in the business cycle.

A simple form of labour market hysteresis can be incorporated into the NCM 3-equation model that we have been studying in the previous chapters. Figure 12.1 shows how the $$WS$$ curve rotates counterclockwise due to an increase in the conflict orientation of employees, $$k$$. Here it is assumed that the increase in $$k$$ was caused by the unemployment rate being below the original NAIRU for some time after a demand shock has hit the economy. The counterclockwise rotation of the $$WS$$ curve leads to a new distributional equilibrium at the left of the old equilibrium value corresponding to a new and now higher value of the NAIRU.

Figure 12.1: Rotation of the WS curve thanks to improved bargaining position of the still employed.

We illustrate this in the “hysteresis” scenario accessible via the link below. Let’s make the case of a positive shock to aggregate demand. At the beginning of the simulation, the economy is hit by the demand shock. The central bank will react by temporarily raising the unemployment rate above the NAIRU in order to reverse inflation expectations, just as we have learned with the previous scenarios. However, if the unemployment rate is higher than the NAIRU for more than one period, the hysteresis effect will be triggered and part of the unemployed will withdraw from the labour market. This improves the bargaining position of the labour force (remember that $$k$$ increases) reducing output, the associated inflation-stable employment ($$L^N$$ shifts to the left) and increasing the NAIRU. The central bank observes the change in the NAIRU and in the inflation-stable employment level and start to target the new values adjusting the optimal path to the inflation target. This new path is indicated by a shift of the $$MR$$ curve. This case and the case of labour market hysteresis after a positive demand shock can be tested with the following interactive scenario.

## 12.2 Endogeneity of the NAIRU 2: interest rate elastic mark-up

The second endogeneity channel of the NAIRU that we want to investigate is the effect of a change in the interest rate on firms’ production costs and real wage target (see Hein , Hein and Stockhammer (2009, 2011)). Here, interest rate changes arise as a result of the central bank’s response to demand or supply shocks.

In our price equation (9.8), the mark-up of firms must cover not only profits per unit but also all general production costs per unit that do not result from wage payments. Since interest costs are part of the production costs, in this case costs for borrowing capital, it seems plausible to assume that interest costs have an impact on the mark-up. Under this assumption, a change in the interest rate will have an impact on firms’ pricing, if not immediately, at least in the medium-run. If an increase in the interest rate is perceived by firms to be permanent, we then might observe an increase in the mark-up. Under this assumption, the mark-up would become a function of the nominal interest rate set by the central bank:

$$$m = m(i) \tag{12.1}$$$

It is plausible to assume that companies will adjust the mark-up to an increase in the interest rate not immediately but after a certain time, as they first may want to see whether the increase in the interest rate is permanent or temporary. The reason for the possible delayed reaction of the firms may be that they do not want to scare off their customers by adjusting prices too quickly. Another reason could be that the increase in interest costs is perceived by companies only after a certain amount of time.

From a modeling perspective, the interest rate responsiveness of the mark-up means that the $$PS$$ curve will shift downward after some periods as a consequence of a positive demand shock and the following reaction of the central bank, as figure 12.2 shows. This causes the inflation-stable employment level to fall, the NAIRU to rise, and wage-price-wage spirals to start when current employment is above the new inflation-stable employment. Because of the higher mark-up and the lower target real wage rate of firms which ultimately determines the realised real wage rate, the central bank’s interest rate policy has an indirect influence on the real wage rate and thus on the distribution of income between wages and profits, which consist of retained profits and distributed interest payments. In addition, the central bank interest rate policy has influenced the inflation-stable employment level and the corresponding NAIRU in the long-run.

Figure 12.2: Interest rate increases shift the PS curve.

In a simplified modeling implementation, in the interactive “interest-elastic mark-up” scenario we assume that the mark-up $$m$$ becomes a function of the moving average value of the interest rate:

$$$m = m(\bar{i}) \tag{12.2}$$$

The underlying assumption at play here is that as soon as companies perceive the change in the interest rate to be permanent, they will try to defend their (net) profit margins by adjusting the price mark-up. If we assume such behaviour, a problem arises for the central bank: its interest rate policy, which is actually aimed at short-term demand management, now has long-term non-intended effects on price setting and thus on the inflation rate and the NAIRU itself. In the case of excessively high inflation, tight monetary policy can now contribute to a higher NAIRU in the long-run. Monetary policy is much less efficient compared to the NCM version of the 3-equations model due to non-intended and long-run real economic effects. In the “interest-elastic mark-up” scenario accessible through the link below, the optimal adjustment process in response to a positive demand shock is disrupted by firms adjusting their mark-up to reflect increased interest costs. The change in the price mark-up leads to a reduction in inflation-stabilising employment and an to an increase in the NAIRU, affecting directly the price level and leading to a second spike in inflation. The central bank must then raise the interest rate again. By taking the cost effect of interest rate changes into account, the central bank must pursue a more restrictive interest rate policy which has macroeconomic effects beyond the short-run. Stable inflation is possible only with a higher long-run unemployment rate.

In summary, this scenario shows that once the interest rate sensitivity of the mark-up is included in the model, a restrictive monetary policy has the side effect of lowering the inflation-stable employment level and raising the NAIRU. Compared to the standard version of the NCM model, monetary policy is no longer neutral in the long-run. Relying solely on interest rate policy to fine-tune the economy leads to long-run employment losses and, if the impact on the mark-up is strong, may not even lead to a stable long-run equilibrium.45

## 12.3 The NAIRU as a corridor: a horizontal element in the Phillips curve

For the linear wage-setting curve discussed so far and the associated linear short-term Phillips curve, we have assumed that the rising (or falling) inflation rates caused in the distributional disequilibrium do not influence the target real wage rate of employees. This assumption is plausible if employees assume that their individual or company-specific nominal wage increases have no influence on the overall economic inflation rate. This assumption is plausible if employees assume that their individual or firm-specific nominal wage increases do not affect the general inflation rate at the macro level. This will be particularly the case in highly decentralised and uncoordinated wage bargaining, where wage bargaining takes place individually or, at best, at the firm level. However, when wage negotiations and wage agreements are conducted at industry level and, if necessary, coordinated between industries (e.g. through the wage leadership of an industry that is particularly well organised in terms of trade unions, such as the metal industry with IG Metall in Germany), the trade unions can take into account the effects of the nominal wage increases they have achieved on the overall inflation rate. If they now want to avoid rising inflation rates, for example not to lose price competitiveness against their foreign competitors or to prevent interest rate hikes by the central bank, they must assume joint responsibility for inflation. This means that wage negotiators must adjust nominal wage growth - at constant labour productivity - to the target inflation rate. This is tantamount to adjusting their target real wage rate to the level made possible by firms’ price setting, i.e. to the target real wage rate of firms.

Within a certain “normal” employment range, the real wage targets of employees coincide with the real wage targets of firms derived from price setting, as can be seen in figure 12.3. Within the horizontal element of the $$WS$$ curve, there is neither inflationary nor disinflationary pressure (see Hein 2006; 2023, chap. 6). Macroeconomic coordination of wage increases will work only within this “normal corridor” of employment levels and unemployment rates assuming that the necessary conditions exist (strong trade unions, strong business associations, negotiations at the industry or macroeconomic level with effective coordination).

Figure 12.3: Horizontal element in the wage-setting and Phillips curves.

If the employment level rises above the normal corridor and the unemployment rate falls below the corresponding value, firms will start to compete for scarce labour, nominal wage growth will rise above the target inflation rate and the process of accelerating inflation will begin, as shown in figure 12.4. In the opposite situation with employment above the normal corridor, employees are willing to make nominal wage concessions in order to preserve their jobs. Nominal wage will fall below the target inflation rate and the well-known disinflation and deflation processes will start.

Figure 12.4: Employment beyond the inflation-stable employment corridor.

If target real wage rates of firms and trade unions agree for a given employment corridor, there is an horizontal element also in the short-run Phillips curve. A constant inflation rate is compatible with all employment levels within this horizontal interval and the NAIRU becomes a corridor. The Phillips curve has now turned into a function with three elements:

$$$\pi = \begin{cases} \pi_{-1}+k \left( L^* - L^{N_{\text {u}}} \right) & L^*<L^{N_{\text {u}}} \\ \pi_{-1} & L^{N_{\text{u}}} < L^* < L^{N_{\text{o}}} \\ \pi_{-1}+k\left(L^* - L^{N_{\text {o}}}\right) & L^* > L^{N_{\text {o}}} \end{cases} \tag{12.3}$$$

The upper part of the figure 12.5 shows how, thanks to the introduction of the horizontal element in the short-run Phillips curve, a constant inflation rate is compatible with different employment levels and different unemployment rates. With this modification, the NAIRU is now a range of values rather than a single definite value. As soon as employment falls above (below) the bounds of this employment corridor, inflation starts to rise (fall).

Figure 12.5: Operation of the employment corridor.

In addition to the process of macroeconomic coordination in the wage bargaining process described above, there is another reason that justify the presence of the horizontal element in the Phillips curve. After deep recessions with high unemployment, employees and unions may have little or no conflict orientation during the following recovery phase when employment is on the rise. Temporary tamed conflict may well prevent wage acceleration in the upswing of the business cycle. The economy may then have persistently low inflation under adaptive expectations even when employment rises after a recession.

If we now include the Phillips curve with the horizontal element in the 3-equation model, we can show that the political assignment of monetary, fiscal and wage/income policy can be no longer separated, as the NCM approach suggests. The result is a change in the policy mix that is still valid in macroeconomic terms. With a horizontal element in the Phillips curve, there is the possibility for the central bank to tolerate lower unemployment rates than in the NCM. Active fiscal policy can now help to ensure that an inflation-stable level of employment increased by wage coordination is achieved on a long-run basis through appropriate demand management.

This change has profound implications for the proposed macroeconomic policy mix. While the NCM approach focuses on reducing labour market rigidities, fragmenting and decentralising wage bargaining, reducing the rights of employees and dismantling the social security systems, the post-Keynesian approach proposes alternative measures. Within the post-Keynesian policy framework, wage coordination should aim at achieving the inflation target. Instead of basing their nominal wage decisions on expected (i.e. lagged) inflation, workers and firms should raise nominal wages in a coordinated manner according to the rate of medium-term productivity growth plus the inflation target. This would prevent the Phillips curve from remaining at a low (high) level after an economic downturn (upturn). The post-Keynesian Phillips curve extended to include wage policy becomes:

$$$\pi = \begin{cases} \pi^{T}+k \left( L - L^{N_{\text {u}}} \right) & L<L^{N_{\text {u}}} \\ \pi^{T} & L^{N_{\text{u}}} < L < L^{N_{\text{o}}} \\ \pi^{T}+k\left(L-L^{N_{\text {o}}}\right) & L>L^{N_{\text {o}}} \end{cases} \tag{12.4}$$$

In this model, effective coordination of wage bargaining appears to be a superior policy tool when it comes to dampening inflation during the upswing of the business cycle. Moreover, effective coordination of wage bargaining facilitates the stabilisation of the economy during a downturn and prevents harmful disinflation and deflation processes. This provides the basis for actively managing aggregate demand through fiscal and monetary policy to achieve high levels of non-inflationary employment.

In the interactive scenario with post-Keynesian Phillips curve accessible via the link below, a simplified version of this set of policy recommendations can be simulated. In this scenario, the economy is again hit by a permanent demand shock. In the first round, employees follow adaptive inflation expectations. If the demand shock is large enough to bring employment above (below) the upper bound (the lower bound) of the horizontal element, accelerated (decelerated) inflation is observed. Wage, fiscal, and/or monetary policy can now be used to bring the economy back to the inflation target and to a high level of employment. In choosing wage policy within the horizontal corridor of the Phillips curve, bargaining agents will follow a post-Keynesian wage rule, i.e. unit labour costs will rise with target inflation. Since we assume productivity growth to be zero, this implies that nominal wages rise with target inflation. Outside the horizontal corridor, however, wage coordination is ineffective leading to a persistent deviation of inflation from target. In this case, fiscal and/or monetary policy must intervene to influence aggregate demand and to bring demand and employment back to the horizontal element of the Phillips curve.

This scenario shows the crucial role of policy coordination for the macroeconomic adjustment after the shock. If the shock raises (lowers) inflation and demand management is combined with post-Keynesian wage policy in the horizontal segment of the Phillips curve, it will not be necessary to bring employment below (above) the lowest (highest) inflation-stabilising level to achieve the inflation target. It is sufficient to bring employment back to the inflation-stabilising corridor through monetary or fiscal policy.

Moreover, if the assumption of a horizontal element in the Phillips curve were combined with the assumption of an interest-elastic mark-up, the idea of the NCM model on monetary policy to take on the role of demand management would have to be abandoned. Demand management with fiscal policy becomes necessary to avoid negative effects of interest rate hikes in the upswing. Monetary policy committed to low and stable real interest rates (e.g. at the rate of long-term productivity growth) can also help reduce the NAIRU and thus create more room for expansionary fiscal policy and higher employment. Therefore, in the post-Keynesian framework, wage and income policy would be responsible for nominal stabilisation, while fiscal policy should be aiming at a high level of employment with the goal of real stabilisation. Monetary policy should support this policy mix by pursuing a policy of low interest rates. In stark contrast to NCM policy, the post-Keynesian policy framework requires a high degree of wage coordination, strong business organisations and strong unions operating in organised labour markets where actors recognise and exercise the responsibility of wage bargaining for nominal stabilisation.

## 12.4 Economic policy in the post-Keynesian model

We can conclude this chapter by briefly summarising the policy mix (or the policy assignment) that emerges from a post-Keynesian macroeconomic model Hein and Stockhammer (2009):

Monetary policy of the central bank should aim for low interest rates. Interest rates influence income distribution and through this affect the macroeconomy. Real interest rates should not exceed the growth of real output or, in the long-run, productivity growth, because only then will the distribution between wages, retained profits and interest income remain constant. Similarly, nominal interest rates should not exceed nominal output growth.46

Labour market, wage, and incomes policies affect the price level/inflation and distribution. Flexible nominal wages tend to destabilise the economy, as they cumulatively reinforce disinflation and deflation processes, as well as inflation processes. Therefore, wage policy should aim at stable growth of unit labour cost in line with the inflation target. Nominal wages should therefore grow at the same rate as the sum of productivity growth and the inflation target. At the macro level, this requires coordinated wage negotiations with strong unions and strong business associations.

Fiscal policy is given an active role in the post-Keynesian policy mix and is responsible for real stabilisation in the short and long-run. For this purpose, politically set fiscal deficit targets and debt targets are not suited. Instead, the government’s budget deficits (or surpluses) should be designed to allow for the highest possible inflation-stable employment on the demand side. To ensure that the government remains capable of acting even in the face of high deficits and high public debt, it needs the support of the central bank, which should maintain low interest rates on public debt by intervening in the financial market.47

Policy coordination: since the economic policy actors, the central bank, the government through its fiscal policy, the collective bargaining actors with the use of their instruments have an influence on both employment and inflation both in the short and in the long-run, economic policy must be agreed and coordinated between them. In the post-Keynesian approach, a clear assignment of instrument and target to the different economic policy actors, as in the NCM approach in the long-run, is not possible.

## Further reading on chapter 12

Textbooks:

Other literature:

### Literature

Arestis, P. 2013. “Economic Theory and Policy: A Coherent Post-Keynesian Approach.” European Journal of Economics and Economic Policies: Intervention 10 (2). Edward Elgar Publishing: 243–55.
Ball, L. 1999. “Aggregate Demand and Long-Run Unemployment.” Brookings Papers on Economic Activity 1999 (2): 189–251.
Ball, L. 2014. “Long-Term Damage from the Great Recession in OECD Countries.” European Journal of Economics and Economic Policies: Intervention 11 (2). Edward Elgar Publishing: 149–60.
Blanchard, O., and L. Summers. 1987. “Hysteresis in Unemployment.” European Economic Review 31 (1-2): 288–95.
Blanchard, O., and L. Summers. 1988. “Beyond the Natural Rate Hypothesis.” The American Economic Review 78 (2): 182–87.
Hein, E. 2006. “Wage Bargaining and Monetary Policy in a Kaleckian Monetary Distribution and Growth Model: Trying to Make Sense of the NAIRU.” European Journal of Economics and Economic Policies: Intervention 3 (2). Edward Elgar Publishing: 305–29.
Hein, E. 2017. “Post-Keynesian Macroeconomics Since the Mid 1990s: Main Developments.” European Journal of Economics and Economic Policies: Intervention 14 (2). Cheltenham, UK: Edward Elgar Publishing: 131–72.
Hein, E. 2023. Macroeconomics After Kalecki and Keynes: Post-Keynesian Foundations. Cheltenham: Edward Elgar Publishing, forthcoming.
Hein, E., and M. Lavoie. 2019. “Post-Keynesian Economics.” In The Elgar Companion to John Maynard Keynes, edited by M Hagemann and R. Dimand. Cheltenham, UK: Edward Elgar Publishing.
Hein, E., and E. Stockhammer. 2009. “A Post Keynesian Alternative to the New Consensus Model.” In Macroeconomic Theory and Macroeconomic Pedagogy, edited by G. Fontana and M. Setterfield, 273–94. Basingstoke: Palgrave Macmillan.
Hein, E., and E. Stockhammer. 2011. “A Post-Keynesian Macroeconomic Model of Inflation, Distribution and Employment.” In A Modern Guide to Keynesian Macroeconomics and Economic Policies, edited by E. Hein and E. Stockhammer, 112–36. Cheltenham, UK: Edward Elgar Publishing.
Hein, E., and E. Stockhammer (eds). 2011. A Modern Guide to Keynesian Macroeconomics and Economic Policies. Cheltenham, UK: Edward Elgar Publishing.
King, J. E. 2015. Advanced Introduction to Post Keynesian Economics. Cheltenham, UK: Edward Elgar Publishing.
Lavoie, M. 2006. Introduction to Post-Keynesian Economics. Basingstoke: Palgrave Macmillan.
Lavoie, M. 2014. Post-Keynesian Economics: New Foundations. Cheltenham, UK: Edward Elgar Publishing.
Stockhammer, E., and S. Sturn. 2011. “The Impact of Monetary Policy on Unemployment Hysteresis.” Applied Economics 44 (21): 2743–56.

1. For an introduction to post-Keynesian theory, see e.g. Hein (2023, chaps. 2–3), Hein and Lavoie (2019), King (2015), Lavoie (2006), and the contributions in Hein and Stockhammer (eds) (2011). For an overview of the foundations of post-Keynesianism and developments in post-Keynesian macroeconomics, see Hein (2017). Hein (2023) and Lavoie (2014) are detailed advanced textbooks. Post-Keynesian macroeconomic models with the corresponding policy recommendations have been presented, among others, by Arestis (2013), Hein and by Hein and Stockhammer (2009), Hein and Stockhammer (2011).↩

2. See e.g. Hein , Hein and Stockhammer (2009).↩

3. In addition, the central bank should stabilise the financial sector by using other instruments (lender of last resort, credit controls, guarantees of sovereign debt to keep the government able to perform its role).↩

4. Through its tax and social policy, the government also influences the distribution of disposable income. In this context, progressive taxation improves automatic stabilisers in upswings and downturns.↩


text:
# Direction of the resultant displacement Math help

Problem: A disoriented physics professor drives a distance 3.15km north, then a distance 2.50 km west, and then a distance 1.30km south. Find the direction of the resultant displacement, using the method of components.

So I have done this problem over and over and I keep getting -36.5 degrees west of north. But on Mastering Physics it keeps stating my answer is wrong.

What I did was calculate $\arctan((3.15−1.3)/(−2.5))$ to get the direction of the resultant am I wrong to compute what I wrote before?

Be careful with your angle directions and negative signs. After taking the absolute value, you should get an angle of: $$\arctan\left( \dfrac{3.15 - 1.30}{2.50} \right) \approx 36.5^\circ \text{ North of West} = 53.5^\circ \text{ West of North}$$


text:
## Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

## Discussion Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentRowNumber1.
• CommentAuthorhilbertthm90
• CommentTimeSep 13th 2011

Modulo the definition, I’ve created Picard scheme. One thing I couldn’t tell, is there a standard term in nlab for the “fiber category” of a stack? I mean if $F:C\to D$ fibers $C$ over $D$ then if you pick some object $X$ from $D$ the category $C_X$ consisting of objects that go to $X$ and morphisms that go to $id_X$.

• CommentRowNumber2.
• CommentAuthorUrs
• CommentTimeSep 13th 2011

is there a standard term in nlab for the “fiber category” of a stack?

I don’t think there is currently. I would call this simply “the value of the stack at $X$”. But feel free to introduce an entry for this, if you need it.

• CommentRowNumber3.
• CommentAuthorMike Shulman
• CommentTimeSep 13th 2011

If you’re thinking of a stack as a pseudofunctor, then “the value of the stack at $X$” seems most sensible. If you prefer to think of it as a fibration, then I think “the fiber over $X$” also makes perfect sense. Of course in neither case does it depend on the pseudofunctor/fibration being a stack.

• CommentRowNumber4.
• CommentAuthorhilbertthm90
• CommentTimeSep 13th 2011

Yes, that’s why I clarified by merely saying “if $F:C\to D$ fibers $C$ over $D$” to point out that if the term existed it probably wasn’t just for stacks.

• CommentRowNumber5.
• CommentAuthorUrs
• CommentTimeMay 14th 2014
• (edited May 14th 2014)

The Idea-section at Picard scheme claimed (,aybe that was me, I forget) that it is the geometric incarnation of the Picard group. I have added the warning that often (usually) it is just the connected component of that which is being referred to. In fact I have added the following paragraph:

Often one considers just the connected component $Pic_X^0$ of the neutral element in $Pic_X$, and often (such as in the discussion below, beware) it is that connected component (only) which is referred to by “Picard scheme”. The quotient $Pic_X/Pic_X^0$ is called the Néron-Severi group of $X$.

Related to this: the discussion on the page as of now is not very transparent conceptually. I have added links to Akhil Mathew’s nice posts on this, which go a bit further in actually explaining what’s going on. But it seems to me this could further be improved on.


text:
Home / Posts / Incremental select with treesitter View Raw
09/07 — 2022
29.17 cm   2.6 min

# Incremental select with treesitter

treesitter is a tool that can build a concrete syntax tree for a source file and incrementally update the tree as the file is modified.

Recently, I’ve been experimenting more and more with treesitter’s query DSL and an abstraction layer in the form of a neovim plugin, and found a configuration option to be particularly useful when editing code: incremental selection.

When you write a treesitter parser, you must write a grammar that treesitter can read, which it then uses to generate the parser. This grammar specifies the named syntax nodes in the tree and how they relate to other nodes.

For instance, if we head over to the syntax tree playground and parse rust source code that looks like this:

fn main() {
println!("Hello, world!");
}

we get the following syntax tree output:

source_file [0, 0] - [3, 0]
function_item [0, 0] - [2, 1]
name: identifier [0, 3] - [0, 7]
parameters: parameters [0, 7] - [0, 9]
body: block [0, 10] - [2, 1]
macro_invocation [1, 2] - [1, 27]
macro: identifier [1, 2] - [1, 9]
token_tree [1, 10] - [1, 27]
string_literal [1, 11] - [1, 26]

The neovim plugin written as an abstraction layer for treesitter usage within neovim is able to parse your source file as you type. That is, it’s able to compute a syntax tree that resembles the one shown above, on the fly.

As you hover over a certain part of a file, it is able to detect which node you’re currently at in the tree.

The plugin includes a configuration option which allows for the setting of keybindings for initializing a node selection and incrementing a selected node range – configured like so:

incremental_selection = {
enable = true,
keymaps = {
init_selection = "<cr>",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
}
}

Incremental selection has improved the rapidity in which I can yank or replace blocks of text in treesitter parsed source files, as expanding a node selection with a keybinding is super fast and usually results in the exact block of text I want to modify.

Here’s a quick demo of it in action:

A reference of my full neovim configuration can be found on github, in my dotfiles repo. Be sure to check it out!

Hi.

I'm Liam.

I am compsci undergrad with a minor in mathematics @ mcgill university, rust enjoyer and (neo)vim enthusiast. For fun I enjoy working on open-source projects, reading, and lifting weights.

Send me a message by email: liam [at] scalzulli.com or matrix: worse:matrix.org

Home / Posts / Incremental select with treesitter View Raw