A complex function defining RuleSets for purification and tomography on the link. This function creates one rule per purification. As the work proceeds, a resource gets promoted from rule to rule (on purification success), so if you ask for three rounds of purification, it will emit three purification rules.
For example, with "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z", the first instance of "first stage X
purification" (Rule0) includes allocating the resources from the base pair pool, executing the purification circuit (including measurement), exchanging the result messages, comparing and either promoting or discarding, so a one-way classical messaging latency is incurred here.
Then, the "second stage Z purification" (Rule1, the first time through the loop) begins by drawing two Bell pairs that have each been promoted by the first X purification (rule 0). An additional one-way latency is incurred here.
These actions are alternated initial_purification times, for a total of 2n rules (and 2n times the one-way latency). Note that the semantics of initial_purification vary depending on the purification_type. In the descriptions below, $n$ is initial_purification.
Pumping doesn't really work because of the way resources are controlled as they are promoted from rule to rule. At the moment, base Bell pairs (those created directly by the link) exist in a pool, ordered by age. Over in Action.cc, you will find Action::getResource_fromTop(). This selects the oldest Bell pair. At the moment, only the first rule (Rule0) draws from this pool; however, pumping would require that later rules also be able to draw from the pool.
A purification scheme must be characterized by both the circuit being executed, and the scheduling discipline for selecting the inputs to the circuit. The scheduling discipline in theory can be pumping, symmetric tree (perfect binary tree), or banded, and should also specify how the resources are sorted. Currently, this is hard-coded to select oldest first, and is geared toward symmetric tree.
Purification_type "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":
- name: Ss-Sp / perfect binary tree, even rounds
- rounds: 2n
- input Bell pairs per round: 2
- total Bell pairs: 2^(2n)
- circuit: Fig. 6.3 in Takaaki's master's thesis
- scheduling: symmetric tree
description:
Ss-Sp is single selection, single error purification. Between rounds, Hadamard gates are applied to switch basis, creating alternating rounds of X and Z purification.
The only difference between "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" and "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" is the semantics of initial_purification. Here, each iteration results in two rules, guaranteeing an even number of rounds.
X always goes first. 
Purification_type "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":
- name: Ss-Sp / perfect binary tree, odd or even rounds
- rounds: n
- input Bell pairs per round: 2
- total Bell pairs: 2^n
- circuit: Fig. 6.3 in Takaaki's master's thesis
- scheduling: perfect binary (symmetric) tree
description:
Ss-Sp is single selection, single error purification. Between rounds, Hadamard gates are applied to switch basis, creating alternating rounds of X and Z purification.
The only difference between "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" and "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" is the semantics of initial_purification. Here, each iteration results in one rule, X for even-numbered rounds (counting from zero), Z for odd-numbered ones, so it is possible to do XZX or XZXZX (but not ZXZ or ZXZXZ). 
Purification_type "N_SINGLE_XZ":
- name: Ss-Dp XZ Purification
- rounds: n
- input Bell pairs per round: 3
- total Bell pairs: 3^n
- circuit: Fig. 12 in arXiv:1904.08605
- scheduling: symmetric tree
description:
Both X and Z purification in a single action. If A is the pair being purified, and C and E are tools, CNOT(A,C), MEAS(C), CNOT(E,A), MEAS(E) then select after comparing outcomes. Note that bases are not flipped between rounds. Similar to "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX". 
Purification_type "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX":
- name: Ss-Dp XZ, ZX alternating
- rounds: n
- input Bell pairs per round: 3
- total Bell pairs: 3^n
- circuit: almost Fig. 12 from arXiv:1904.08605, but order of CNOTs reversed in alternating rounds
- scheduling: symmetric tree
description:
Almost the same as "N_SINGLE_XZ", but first round is XZ, second round is ZX. Results in better alternating error suppression, but still not great. 
Purification_type "N_DOUBLE_X":
- name: Ds-Sp: Fujii-san's Double selection purification
- rounds: n
- input Bell pairs per round: 3
- total Bell pairs: 3^n
- circuit: Fig. 13 in arXiv:1904.08605
- scheduling: symmetric tree
description:
Similar to "N_SINGLE_XZ" and "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX" except that the control and target of the first CNOT are flipped, corresponding to Fujii-san's paper (PRA 80, 042308). Every round is identical. Note there is no basis change between rounds. 
Purification_type "N_ALTERNATE_DOUBLE_X_WITH_DOUBLE_Z":
- name: Ds-Sp: Fujii-san's Double selection purification (alternating)
- rounds: n
- input Bell pairs per round: 3
- total Bell pairs: 3^n
- circuit: almost Fig. 13 in arXiv:1904.08605, except that the order of the CNOTs alternates between rounds
- scheduling: symmetric tree
description:
Similar to "N_DOUBLE_X", almost corresponding to Fujii-san's paper (PRA 80, 042308). Note there is no basis change between rounds, but that the first round is XZ, second is ZX. 
Purification_type "N_ALTERNATE_DOUBLE_XZ_WITH_DOUBLE_ZX":
- name: Ds-Dp: full double selection purification (alternating)
- rounds: n
- input Bell pairs per round: 5
- total Bell pairs: 5^n
- circuit: Fig. 14 in arXiv:1904.08605, except that the order of the CNOTs alternates between rounds
- scheduling: symmetric tree
description:
A combination of "N_SINGLE_XZ" and "N_DOUBLE_X" (Figs. 12 & 13). Resource requirements are high; two rounds of this requires 25 Bell pairs. With a low base Bell pair generation rate and realistic memory decoherence, this will be impractical. 
Purification_type "N_ALTERNATE_DOUBLE_X_SINGLE_Z_WITH_DOUBLE_Z_SINGLE_X":
- name: half double selection, half single selection
- rounds: n
- input Bell pairs per round: 4
- total Bell pairs: 4^n
- circuit: no figure available
- scheduling: symmetric tree
description:
Does double selection on X, single selection on Z Switches bases between rounds. Investigated for possibly highly asymmetric X/Z error rates in base Bell pairs. Initial results weren't very promised, not extensively used.
Purification_type "2+N_DOUBLE_X_THEN_DOUBLE_Z_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":
- name: Switching (B)
- rounds: n
- input Bell pairs per round: 3 in first two rounds, then 2
- total Bell pairs: (complicated)
- circuit: Fig. 21, case B in arXiv:1904.08605
- scheduling: symmetric tree (*)
description:
Two rounds of Ds-Sp, then Ss-Sp. The point of this was to show that you don't have to stick with one scheme, but can use different schemes in different rounds.
Purification_type "1+N_DOUBLE_X_ALTERNATE_SINGLE_Z_WITH_SINGLE_X":
- name: Switching (A)
- rounds: n
- input Bell pairs per round: 3 in first round, then 2
- total Bell pairs: (complicated)
- circuit: Fig. 21, case A in arXiv:1904.08605
- scheduling: symmetric tree (*)
description:
One round of Ds-Sp, then Ss-Sp. The point of this was to show that you don't have to stick with one scheme, but can use different schemes in different rounds.
Purification_type default:
- name: Boolean-driven (obsolete)
- rounds: 1
- input Bell pairs: 2 or 3
- total Bell pairs: 2 or 3
- circuit: <reference a figure>
- scheduling: (commonly pumping, symmetric tree, or banded)
description:
uses X_Purification and Z_purification booleans, but is obsolete. Creates a single purification only, or a single round of double purification. Use of this for new work is deprecated.