text:
\section{Introduction}
Single reference coupled cluster (CC) theory\cite{Paldus1999,Bartlett2007,BartlettShavitt} is considered the `gold standard' for weakly-correlated problems in quantum chemistry.  Although its native $\mathcal{O}(N^6)$ scaling is somewhat formidable, CC with single and double excitations (CCSD)\cite{CCSD} can be applied to very large systems once one exploits locality\cite{Hampel1996,Scuseria1999,Schutz2001,Flocke2004} or uses tensor decompositions\cite{Koch2003,Hohenstein2012,Hohenstein2012b,Benedikt2013,Hummel2017,Schutski2017} to reduce the scaling.

Despite its success in capturing weak correlation, single-reference CC is generally insufficient for strongly-correlated systems in which the single reference is incapable of providing an adequate approximate description of the ground state.  When the number of strongly correlated electrons is not too large, one may overcome this weakness by incorporating higher excitations in the cluster operator (e.g. by adding triple and quadruple excitations to reach CCSDTQ).  This is particularly appealing if one can usefully approximate the higher-order cluster amplitudes rather than solving for them (see, for example, Ref. \onlinecite{Takahashi1984}).  More straightforwardly, one may allow symmetries to break at the mean-field level.  The resulting broken-symmetry mean-field state is usually an unrestricted Hartree-Fock (UHF) determinant which can capture some of the most important features of the relevant strong correlation, and can serve as a useful starting point for standard single-reference CC.  The price paid can be high, however: the broken symmetry can lead to poor prediction of properties, complications with assigning states, and so on.

In order to achieve a better starting point for strong correlation, one can adopt projected Hartree Fock (PHF) theory.\cite{Lowdin1955,Ring1980,Blaizot1985,Schmid2004,PHF}  In PHF, one deliberately breaks
symmetries of the system, then applies a symmetry projection operator to the broken-symmetry mean-field state.  The end result is a multi-determinantal symmetry eigenstate which is parametrized by a broken-symmetry single determinant.  The underlying mean-field nature of the method means that PHF has mean-field computational scaling.

While PHF can handle many kinds of strong correlation in a black-box manner, the fact that it is a kind of mean-field method means that it is generally unable to describe the weak correlations for which standard correlation techniques are so well suited.  Thus, significant attention has been paid over the past several years to combining PHF with configuration interaction (CI)\cite{Tsuchimochi2016a,Tsuchimochi2016b,Ripoche2017} or even CC.\cite{Duguet2014,Duguet2017,Tsuchimochi2017,Qiu2017,Qiu2018,Tsuchimochi2018,Qiu2019}  The relatively simple nature of the CI wave function means that symmetry-projection of CI is not too complicated.  The CC wave function, however, is far more complicated. Symmetry-adapted alternative coupled cluster methods which incorporate guidance from the PHF wave function have been developed in the past several decades and have shown some promise\cite{Takahashi1984,Piecuch1990,Paldus1991,Piecuch1992,Paldus1996,magoulas2021}, but the exact symmetry-projection of a broken-symmetry CC wave function is not generally feasible.

We are aware of two main approaches one might take to approximately project a CC wave function.  On the one hand, Tsuchimochi and coworkers proposed truncating the exponential of the cluster operator\cite{Tsuchimochi2018} at fourth order, to obtain a balance between computational cost and accurate results. On the other hand, Qiu\cite{Qiu2017} and Duguet\cite{Duguet2014} have independently proposed what we refer to as the disentangled cluster formalism, which we shall explain in more detail below.  The essential feature, however, is that a symmetry-projection operator can be written as a weighted sum of one-body orbital rotation operators, the action of which on a CC state is rather cumbersome. The disentangled cluster formalism writes a rotated CC state as the exponential of a new cluster operator acting on the unrotated reference.  Although formally exact, in practice one must approximate this new cluster operator in some way.  Most of our previous work with the disentangled cluster formalism solved an ordinary differential equation (ODE) to obtain approximate disentangled cluster operators.  In this work, we instead use truncation ideas similar to those of Tsuchimochi and coworkers in combination with the disentangled cluster formulation.  We demonstrate our results for number projected CC in the reduced BCS Hamiltonian, and spin-projected CC in the Hubbard model and a few small molecules.

\section{Projected Coupled Cluster Theory}
Before we discuss our approximation to construct the disentangled cluster operator, we first briefly review symmetry projection and the basic framework of projected CC.  More detailed discussion can be found in, e.g., Ref. \onlinecite{Qiu2019}.

For continuous symmetries such as number or spin, the symmetry projection operator can be written as an integral over symmetry-generated transformations:
\begin{equation}
P = \int d\theta \, w(\theta) \, R(\theta)
\end{equation}
where $R(\theta)$ is a rotation operator (i.e. the exponential of a one-body operator), and $w(\theta)$ is an integration weight which depends on the target symmetry eigenvalue.  Practical calculations discretize the integration.  As a concrete example, we consider number projection, in which the projector can be written as
\begin{equation}
P = \int_0^{2\pi} \mathrm{d}\theta \, \frac{1}{2 \, \pi} \, \mathrm{e}^{-\mathrm{i} \, \theta \, N_0} \, \mathrm{e}^{\mathrm{i} \, \theta \, N}
\end{equation}
where $N$ is the number operator and $N_0$ is the desired particle number.

In projected coupled cluster theory, we write the ground state wave function by acting the projection operator on a broken-symmetry coupled cluster wave function, as
\begin{equation}
|\Psi_\mathrm{PCC}\rangle = P \, \mathrm{e}^U \, |0\rangle = P |\psi_\mathrm{CC}\rangle,
\end{equation}
where $|0\rangle$ is a broken-symmetry determinant, the cluster operator $U$ creates excitations out of $|0\rangle$, and $|\psi_\mathrm{CC}\rangle$ is a broken-symmetry coupled-cluster wave function.  Inserting the projected CC wave function into the Schr\"odinger equation, we obtain
\begin{subequations}
\begin{align}
E &= \frac{\langle 0| H |\Psi_\mathrm{PCC}\rangle}{\langle 0|\Psi_\mathrm{PCC}\rangle} = \frac{\langle 0|H P|\psi_\mathrm{CC}\rangle}{\langle 0|P|\psi_\mathrm{CC}\rangle},
\label{Eqn:PCCEnergy}
\\
0 &= \langle \mu| H - E |\Psi_\mathrm{PCC}\rangle = \langle \mu| \left(H - E\right) \, P |\psi_\mathrm{CC}\rangle,
\label{Eqn:PCCAmps}
\end{align}
\label{Eqn:PCC}
\end{subequations}
where $\langle \mu|$ stands for a set of excited broken-symmetry determinants.

Note that in the absence of the projection operator, Eqns. \ref{Eqn:PCC} reduce to the standard CC equations.  We extract the energy from Eqn. \ref{Eqn:PCCEnergy} and then adjust the amplitudes defining the broken-symmetry cluster operator $U$ by solving Eqns. \ref{Eqn:PCCAmps} for the relevant broken-symmetry determinants $\langle \mu|$ (in projected CCSD, for example, we take $\langle \mu|$ to run over all single- and double-excitations on the reference $\langle 0|$).

We refer the reader to Ref. \onlinecite{Qiu2018} for details on how the amplitude equations are actually solved.  Here, we are chiefly concerned with obtaining the required matrix elements in Eqns. \ref{Eqn:PCC}, for which purpose we use what we call the disentangled cluster approximation.\cite{Duguet2014,Qiu2017,Qiu2018,Qiu2019}

The disentangled cluster approximation is easiest to see by starting with the overlap $\langle 0|P|\psi_\mathrm{CC}\rangle$.  We express this as
\begin{equation}
\langle 0|P|\psi_\mathrm{CC}\rangle = \int \mathrm{d}\theta \, w(\theta) \, \langle 0|R(\theta) \, \mathrm{e}^{U} |0\rangle.
\end{equation}
The key idea is to act the rotation operator to the left on $\langle 0|$, taking advantage of the Thouless theorem\cite{Thouless1960} to write
\begin{equation}
\langle 0|R(\theta) = \langle 0|R(\theta)|0\rangle \, \langle 0| \mathrm{e}^{V_1(\theta)}
\end{equation}
where $V_1(\theta)$ is a single de-excitation operator
\begin{equation}
V_1(\theta) = \sum_{ai} v^i_a(\theta) \, c_i^\dagger \, c_a
\end{equation}
where $i$ and $a$ respectively label orbitals occupied and unoccupied in $\langle 0|$.  We thus have
\begin{equation}
\langle 0|P|\psi_\mathrm{CC}\rangle = \int \mathrm{d}\theta \, w(\theta) \, \langle 0|R(\theta)|0\rangle \, \langle 0| \mathrm{e}^{V_1(\theta)} \, \mathrm{e}^{U} |0\rangle.
\end{equation}
We now act the de-excitation operator on the coupled cluster wave function to the right, and write the result back in coupled cluster form:
\begin{equation}
\mathrm{e}^{V_1(\theta)} \, \mathrm{e}^U |0\rangle = \mathrm{e}^{W(\theta)} |0\rangle
\end{equation}
where $W(\theta)$ consists of a constant ($W_0(\theta)$) and pure excitation operators.  One can use these same basic ideas to evaluate the Hamiltonian overlap and matrix elements between the broken-symmetry coupled cluster wave function and the excited states $\langle \mu|R(\theta)$.

So far, all of this is exact.  The chief difficulty is that even when the cluster operator $U$ is truncated to single and double excitations, the \textit{disentangled} cluster operator $W(\theta)$ contains excitations to all orders and must be in some way approximated.  We might, for example, choose to limit it to include only single and double excitations, discarding its higher-excitation components.  We also must find a convenient way of computing it for each rotation angle $\theta$.  Qiu \textit{et al} proposed integrating a differential equation for $W(\theta)$,\cite{Qiu2017} starting from $W(0) = U$ and truncating the differential equation in some way.  For continuous symmetries such as number or spin, this approach works well; its applicability to discrete symmetries (e.g. a mirror plane spatial symmetry), however, is less certain.

In this work, we propose to follow an alternative scheme for approximately evaluating the disentangled cluster operator.  Although we shall go into more detail shortly, the basic idea is to write a truncated power series expansion of $e^U$ acting on $|0\rangle$, which results in a tractable wave function which can be transformed with $\mathrm{e}^{V_1(\theta)}$ and written in CC form to approximately extract $W(\theta)$.  Note that henceforth we will suppress the explicit gauge-angle--dependence of the disentangled cluster operator $W = W_0 + W_1 + W_2 + \ldots$, where $W_n$ creates $n$-fold excitations when acting on $|0\rangle$.  Note also that this approach was investigated already in Ref. \onlinecite{Qiu2017} but rejected as unsuitable due to slow convergence; we shall show here that in self-consistent calculations, as a practical matter this slow convergence is not so important.

\section{A Series Expansion in Projected CC Theory}
As we have discussed earlier, the approach we investigate here is to assume that the broken-symmetry cluster operator $U$ is in some sense small, so that a power-series expansion in $U$ should make sense.  We begin by writing
\begin{equation}
\mathrm{e}^{V_1} \, \mathrm{e}^{U_1 + U_2 + \ldots} |0\rangle = \mathrm{e}^{W_0 + W_1 + W_2 + \ldots} |0\rangle.
\end{equation}
We find it convenient to separate out $U_1$, writing the left-hand-side of the foregoing equation as
\begin{align}
\mathrm{e}^{V_1} \, &\mathrm{e}^{U_1 + U_2 + \ldots} |0\rangle
 \\ &= \mathrm{e}^{V_1} \, \mathrm{e}^{U_2 + \ldots} \, \mathrm{e}^{-V_1} \, \mathrm{e}^{V_1} \, \mathrm{e}^{U_1} |0\rangle.
\nonumber
\end{align}
From the Thouless theorem, we see that
\begin{equation}
\mathrm{e}^{V_1} \, \mathrm{e}^{U_1} |0\rangle = \mathrm{e}^{W_0^{(1)} + W_1^{(1)}} |0\rangle
\end{equation}
where the notation $W_n^{(k)}$ indicates the portion of $W_n$ which arises from $U_k$.  This means that
\begin{equation}
\mathrm{e}^{W_0 + W_1 + W_2 + \ldots} |0\rangle = \mathrm{e}^{\bar{U}} \, \mathrm{e}^{W_0^{(1)} + W_1^{(1)}} |0\rangle
\end{equation}
where $\bar{U}$ is the similarity-transformation of the non-singles part of $U$ with $V_1$:
\begin{equation}
\bar{U} = \mathrm{e}^{V_1} \, \left(U_2 + U_3 + \ldots\right) \, \mathrm{e}^{-V_1}.
\end{equation}
Transforming $\bar{U}$ again using $W_1^{(1)}$ gives us
\begin{equation}
\tilde{U} = \mathrm{e}^{-W_1^{(1)}} \, \bar{U} \, \mathrm{e}^{W_1^{(1)}}
\end{equation}
and we have, finally,
\begin{equation}
\mathrm{e}^{W_0 + W_1 + W_2 + \ldots} |0\rangle = \mathrm{e}^{W_0^{(1)} + W_1^{(1)}} \, \mathrm{e}^{\tilde{U}}|0\rangle.
\end{equation}

At this point, we expand the exponential to some given order $n$ in the power series expansion, and write the resulting wave function in terms of excitation operators only:
\begin{equation}
\sum \frac{1}{k!} \, \tilde{U}^k |0\rangle = C_0 \, \left(1 + \sum_{k>=1} C_k\right) |0\rangle
\end{equation}
where $C_k$ is a $k$-fold excitation operator; one can then write this configuration-interaction--like wave function in coupled-cluster form so that we obtain
\begin{subequations}
\begin{align}
\mathrm{e}^{W_0} &= C_0 \, \mathrm{e}^{W_0^{(1)}},
\\
W_1 &= C_1 + W_1^{(1)},
\\
W_2 &= C_2 - \frac{1}{2} \, C_1^2.
\end{align}
\end{subequations}
Note that Ref. \onlinecite{Qiu2017} provides an alternative formulation which contains the same substance; we find the approach outlined here conceptually cleaner. However, though this approach may be conceptually straightforward, the actual equations are somewhat cumbersome.  Our derivation and implementation were facilitated by using the symbolic algebra package \textit{drudge} and its accompanying automatic code generation facility \textit{gristmill.}\cite{Drudge}

At this point, it is important to be clear why the expansion we discuss above was abandoned.  When the mean-field reference $|0\rangle$ and the rotated state $\langle 0| R(\theta)$ are nearly orthogonal, the cluster operator $V_1$ is large, so that $\tilde{U}$ may be rather large even if $U_2$ is small.  The power series expansion may converge only slowly, and truncating it at low order might lead to sizable errors.  We shall see later that this concern is frequently not so important; essentially, this is because in the integral over gauge angle $\theta$ the energetically most important region is for $\theta \approx 0$ where $V_1$ is small and this order-by-order expansion works well.  Moreover, our experience suggests that in practice the series expansion converges adequately even for large $V_1$ when the $U$ amplitudes are sufficiently small, as is typically the case, particularly in self-consistent calculations where the $U$ amplitudes are optimized in the presence of the projection operator.  That is, the broken symmetry cluster amplitudes in $U$ are generally smaller when obtained in the presence of the projection operator than when obtained without.\cite{Qiu2018}  Essentially, this is because in the absence of the symmetry projector, the broken-symmetry cluster operator must not only add correlation but must also restore symmetry, but the projector frees the cluster operator from needing to accomplish the second task.

\section{Results}
We test the proposed approach to projected coupled cluster theory both for model systems and for small molecules and consider both projection after variation (PAV) in which we first solve broken-symmetry coupled cluster for the $U$ amplitudes and then project, and variation after projection (VAP) which optimizes the $U$ amplitudes in the presence of the projection operator.  In all cases the broken-symmetry mean-field reference is obtained in a variation after projection sense and is simply the broken-symmetry reference of the projected mean-field theory.  A fully self-consistent procedure which optimizes the mean-field reference in the presence of both the projection operator and the coupled cluster correlator would be very interesting, but is beyond the scope of this work.

The exact result from projected CCSD includes $W$ to all orders, is marked as PCCSD, and is generated using a full configuration interaction code.

\begin{figure*}[t]
\includegraphics[width=\columnwidth]{12_6_erorr.eps}
\hfill
\includegraphics[width=\columnwidth]{12_6_frac.eps}
\caption{Projected coupled cluster in the half-filled 12-site pairing Hamiltonian.  Left panel: error in the total energy.  Right panel: fraction of correlation energy recovered.  Note that the VAP (Ser2) and VAP (Ser3) results are indistinguishable on the scale of the plot.
\label{Fig:Pairing1}}
\end{figure*}

\begin{figure*}
\includegraphics[width=\columnwidth]{40_10_erorr.eps}
\hfill
\includegraphics[width=\columnwidth]{40_10_frac.eps}
\caption{Projected coupled cluster in the 40-site pairing Hamiltonian with 10 pairs.  Left panel: error in the total energy.  Right panel: fraction of correlation energy recovered.  Again, VAP (Ser2) and VAP (Ser3) are identical to the eye.
\label{Fig:Pairing2}}
\end{figure*}

Practical calculations require truncating the disentangled cluster operator, and we take $W = W_0 + W_1 + W_2$ so that we neglect triple-excitations and higher in the disentangled cluster operator.  We may then generate $W_0$, $W_1$, and $W_2$ from $U$ and $V_1$ either by the series expansion method or by the ODE approach.  We use `Ser$n$' to indicate that the disentangled cluster operator $W$ truncated at $W_2$ is obtained through $\tilde{U}^n$ and `Ser' for the expansion to all orders; this latter result differs from PCCSD in that PCCSD does not truncate $W$.  We use `ODE2' for the method which Ref. \onlinecite{Qiu2017} refers to SUCCSD(SD).  Briefly, the ODE for $W_2$ depends on $W_3$ and in ODE2, we set $W_3 = 0$ in solving for $W_2$.  With proper optimization, the computational cost for Ser2, Ser3, and ODE2 is $\mathcal{O}(N^6)$ ($\mathcal{O}(N^3)$ for the reduced BCS Hamiltonian which has seniority symmetry).

\subsection{Number-Projected Coupled Cluster}
We begin by considering number projection in the pairing Hamiltonian, given by
\begin{equation}
H = \sum_p \epsilon_p \, N_p - G \, \sum_{pq} \, P_p^\dagger \, P_q.
\end{equation}
Here, the pairing operators can be written as
\begin{align}
P_p^\dagger &= c_p^\dagger \, c_{\bar{p}}^\dagger,
\\
N_p &= c_p^\dagger \, c_p + c_{\bar{p}}^\dagger \, c_{\bar{p}}
\end{align}
where spinorbitals $p$ and $\bar{p}$ are paired.  We take the single-particle levels to be $\epsilon_p = p$.  As the interaction strength $G$ increases, the system becomes strongly correlated, and mean-field spontaneously breaks number symmetry to give a Bardeen-Cooper-Schrieffer\cite{Bardeen1957} (BCS) wave function which we can correlate using number-broken Bogoliubov coupled cluster.\cite{Henderson2014,Signoracci2015}  Although this system is exactly solvable,\cite{Richardson1963,Richardson1964,Richardson1965} conventional coupled-cluster methods are unable to describe it for $G$ much larger than $G_c$, the value at which the mean field spontaneously breaks symmetry.\cite{Dukelsky2003,Henderson2014}

Figure \ref{Fig:Pairing1} shows that projected BCS is accurate for large $G$ but less so for $G \lesssim G_c$, while BCS-CCSD works well for small and very large $G$ (not shown) but fails to describe intermediate $G$ values.  In contrast, projected CCSD is quite accurate across the whole range of interaction strengths, particularly if the cluster amplitudes are optimized in the presence of the projector.  Figure \ref{Fig:Pairing2} shows that these basic features also hold for a larger system away from half-filling.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{12_6_truc.eps}
\caption{Projected CC errors for the half-filled 12-level pairing model.  Observe that the projected CC energies with series taking through $n=2$ and through $n=3$ are very similar, indicating that the power series expansion gives reasonably well-converged energetics.
\label{Fig:PairingTruncation}}
\end{figure}

Reference \onlinecite{Qiu2019} has already demonstrated that projected CC performs very well for the pairing Hamiltonian.  Our results here are meant to indicate that this is also true if one uses the simple power-series expansion to define the disentangled cluster operators.

There are three sources of error in our calculations.  The first is the truncation of the broken symmetry cluster operator $U$ to single and double excitations.  We will not concern ourselves with examining the effect of $U_3$ and higher in this work.  The second is the truncation of the disentangled cluster operator at $W = W_0 + W_1 + W_2$, and we define this first kind of truncation error as
\begin{equation}
E_\mathrm{TE1} = E(\mathrm{Ser}) - E(\mathrm{PCCSD}).
\end{equation}
Note that $W_3$ and higher do not directly contribute to the energy, so this first kind of truncation error strictly looks at the effect of $W_3$ and higher on the self-consistent solution for $U_1$ and $U_2$.  The third source of error is the approximate computation of the $W$ amplitudes.  In the series expansion method, this means
\begin{equation}
E_\mathrm{TE2} = E(\mathrm{Ser}n) - E(\mathrm{Ser}).
\end{equation}
We would have a similar result for the ODE.  The total truncation error is the sum of $E_\mathrm{TE1}$ and $E_\mathrm{TE2}$, and can help us evaluate the validity of different approximations.

\begin{figure}
\includegraphics[width=\columnwidth]{12_6N.eps}
\\
\includegraphics[width=\columnwidth]{40_10N.eps}
\caption{Variance in particle number in the pairing Hamiltonian.  Top panel: 6 pairs in 12 levels.  Bottom panel: 10 pairs in 40 levels.
\label{Fig:PairingFluctuations}}
\end{figure}

For the half-filled 12-level system, $E_\mathrm{TE1}$ is almost zero for all $G$, which suggests that the effects of $W_3$ and higher on the converged $U$ amplitudes are essentially negligible and the truncation error mainly arises from approximating $W_0 - W_2$.  We see that even in the PAV(Ser2) case, the truncation error is not large (truncation errors are on the order of $10^{-2}$) and PAV(Ser3) performs much better.  In the VAP cases, the truncation error is negligible after optimizing the $U$ amplitudes.

Note that our results, confirming those of previous work, imply that optimization of the cluster amplitudes plays a vital role in projected coupled cluster theory, so that even a finite-order expansion can lead to remarkable agreement with the exact projected CC result.

Finally, as we have discussed previously,\cite{Qiu2017} truncating the disentangled cluster operator to low-order (e.g. through $W_2$) implies approximating the projection operator, so that the symmetry restoration is imperfect.  Figure \ref{Fig:PairingFluctuations} shows fluctuations $\langle N^2 \rangle - \langle N \rangle^2$ in particle number as a function of $G$.  Even with $W$ truncated and with our low-order power series approximations to the truncated $W$, we see that the symmetry is restored almost perfectly and the fluctuations are essentially zero.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{6_6_error.eps}
\\
\includegraphics[width=\columnwidth]{6_6S2.eps}
\caption{Projected CCSD results in the half-filled 6-site Hubbard model.  Top panel: Errors in the total energy.  Bottom panel: Expectation value of $S^2$.
\label{Fig:Hubbard1}}
\end{figure}

\subsection{Spin-Projected Coupled Cluster}
For repulsive two-body interactions, number symmetry breaking is not generally as important (and number is not broken spontaneously at the mean-field level when the interaction is repulsive).\cite{Bach1994}  Instead, spin symmetry breaks spontaneously.  Generally, we are going to be interested only in breaking $S^2$ but not $S_z$ spin symmetry, which at the mean-field level means that we are interested in unrestricted Hartree-Fock (UHF) but not general Hartree-Fock (GHF).  This is simply because most molecules of interest do not have distinct GHF solutions (though some do) while UHF solutions are ubiquitous; they appear in any open-shell molecule and in dissociation of closed-shell molecules to open-shell fragments.

Although we are principally interested in molecular systems, we begin instead with the Hubbard Hamiltonian,\cite{Hubbard1963} a lattice model whose Hamiltonian is
\begin{equation}
H = -t \, \sum_{\langle ij \rangle,\sigma} \left(c_{i,\sigma}^\dagger \, c_{j,\sigma} + \textit{h.c.}\right) + U \, \sum_i n_{i,\uparrow} \, n_{i,\downarrow}
\end{equation}
where the notation $\langle ij \rangle$ indicates we include only sites $i$ and $j$ connected in the lattice.  The first term favors electronic delocalization, while the second penalizes double-occupancy of a lattice site and thus favors electronic localization.  As $U/t$ increases, the Hubbard model becomes more strongly correlated.

Although the Hubbard model contains more interesting physics in two dimensions, we will focus here on the one-dimensional Hubbard model, which can be solved exactly\cite{LiebWu} and which is readily accessible with a full configuration interaction (FCI) code.  Away from half filling, the Hubbard model generally has GHF solutions for large $U/t$, but we are more interested in spin-projected unrestricted CCSD since, as we have noted, molecules tend not to have GHF solutions.  Moreover, spin-projected GHF is already rather cumbersome computationally, and while projected GHF-based CCSD can certainly be implemented, we do not have such a code.  We therefore limit ourselves to the half-filled Hubbard model in this work, as it has UHF but not GHF solutions.  We note, however, that the doped Hubbard model (i.e. away from half filling) is more challenging for projected Hartree-Fock methods, and it is not clear that simple spin-projected CC would be adequate in any event since spin-projected Hartree-Fock has large errors for the doped Hubbard model at large $U/t$.\cite{PhysRevX2015}  Since PHF has significant remaining correlation to capture, we would generally expect the $U$ amplitudes in broken-symmetry CCSD to be large, and our series expansion approach is unlikely to work well in such a case even if projected CCSD is in principle accurate.

\begin{figure}
\includegraphics[width=\columnwidth]{6_6_trunc.eps}
\caption{Truncation error in the half-filled 6-site Hubbard model.  Note that PAV(Ser) has essentially zero error for $U/t \lesssim 15$ and sits underneath the $x$ axis.
\label{Fig:HubbardTrunc}}
\end{figure}

All that being said, we show results for the 6-site half-filled Hubbard model with periodic boundary condition in Fig. \ref{Fig:Hubbard1}.  We see that unrestricted CCSD (UCCSD) has relatively large errors and is generally competitive with spin-projected UHF (SUHF).  Errors are greatly reduced by spin projection of the UCCSD.  The result for the VAP PCCSD approach are particularly good; once again, solution of the broken-symmetry cluster amplitudes in the presence of the projector is important for achieving best accuracy.  We have difficulty converging VAP-PCCSD with third-order or higher power series (i.e. Ser(3) and Ser) near $U/t \approx 8$.  This may be due to a linear dependency in the amplitude equations, which is discussed in more detail elsewhere.\cite{Qiu2018,Tsuchimochi2018}  This one problem aside, our power series approach works well here and as Fig. \ref{Fig:HubbardTrunc} shows is quite close to the exact PCCSD at large $U/t$.

Note that, as with the pairing Hamiltonian, the truncation error is much larger for the PAV approach, although interestingly, the PAV approach gives slightly superior total energies for large $U/t$. The large error in PAV(Ser2) and PAV(Ser3) at small to moderate $U/t$ is caused by the large $U$ amplitudes. We notice that, at $U/t=2$, the maximum $U_1$ and $U_2$ are on the order of $10^{-1}$, while at $U/t=20$, the maximum goes down to $10^{-2}$. As one might expect, truncating the series expansion works well when the broken-symmetry cluster amplitudes in $U$ are small, but is less appropriate when the $U$ amplitudes are large.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{HF.eps}
\\
\includegraphics[width=\columnwidth]{H2O.eps}
\caption{Energy errors in molecular dissociations.  Top panel: dissociation of HF.  Bottom panel: Symmetric dissociation of H$_2$O to H + O + H.
\label{Fig:Molecules}}
\end{figure}

We now turn to a few small molecular dissociation curves, all using the cc-pVDZ basis set. We use PySCF\cite{pyscf,pyscf2} and the coordinate-descent full configuration interaction\cite{cdfci} (CDFCI) method as implemented in CDFCI\cite{CDFCI2} to generate benchmark results deemed to be of near FCI quality. We refer these results as $E^{\mathrm{CDFCI}}$. Figure \ref{Fig:Molecules} shows results for the dissociation of HF and the symmetric double dissociation of H$_2$O ($\angle$ HOH = 104.5$^{\circ}$).  We exclude SUHF from these plots since, while it gives qualitatively reasonable dissociation curves it has large total energy error.  Unrestricted CCSD is fairly good, but does not deliver chemical accuracy, as one might expect.  Adding the projection operator in the PAV sense does not significantly improve upon UCCSD and generally overcorrects; in contrast, the VAP-PCCSD is excellent and differs from the reference results by around 1 mE$_\textrm{h}$ for all bond lengths.  The truncation error is presumably small since VAP(Ser2) and VAP(Ser3) give almost identical results everywhere.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{HFS2.eps}
\\
\includegraphics[width=\columnwidth]{H2OS2.eps}
\caption{The expectation value $\langle S^2 \rangle$ in small molecules.  Top panel: HF.  Bottom panel: H$_2$O.
\label{Fig:S2}}
\end{figure}

These results suggest that VAP(Ser2) is frequently going to be good enough for practical purposes.  Figure \ref{Fig:S2} shows that indeed, such an approach largely eliminates the spin contamination for the small molecules we have considered.  The errors are somewhat larger than in the Hubbard model, and are not entirely systematic, but we think they are small enough given the accurate energetic predictions.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{N2.eps}
\caption{Energy error in N$_2$ dissociation.
\label{Fig:N2}}
\end{figure}

We look at more difficult examples in Figs. \ref{Fig:N2} and \ref{Fig:H10}, which respectively consider dissociation of N$_2$ and of the H$_{10}$ ring; as the latter system is somewhat larger we apply only the Ser2 method.  Although we do less well for these systems, PCCSD still greatly improves upon UCCSD, particularly when done in the VAP manner.

\begin{figure}
\includegraphics[width=\columnwidth]{H10.eps}
\caption{Energy error in H$_{10}$ symmetric dissociation.
\label{Fig:H10}}
\end{figure}

\begin{figure}[t]
\includegraphics[width=\columnwidth]{4PAV_RMS_w0.eps}
\\
\includegraphics[width=\columnwidth]{4PAV_RMS_w1.eps}
\\
\includegraphics[width=\columnwidth]{4PAV_RMS_w2.eps}
\caption{RMS error in $W$ from different approximation at $U/t=4$ with exact $U$.  Top panel: Error of $W_0$.  Middle panel: Error of $W_1$. Bottom panel: Error of $W_2$.
\label{Fig:4PAV}}
\end{figure}

\begin{figure}[t]
\includegraphics[width=\columnwidth]{20PAV_RMS_w0.eps}
\\
\includegraphics[width=\columnwidth]{20PAV_RMS_w1.eps}
\\
\includegraphics[width=\columnwidth]{20PAV_RMS_w2.eps}
\caption{RMS error in $W$ from different approximation at $U/t=20$ with exact $U$.   Top panel: Error of $W_0$.  Middle panel: Error of $W_1$. Bottom panel: Error of $W_2$.
\label{Fig:20PAV}}
\end{figure}

\subsection{Comparison with the ODE Method}
We have seen that the simple power-series expansion approach works well. Here, we want to compare with the earlier ODE-based approach.

We do not want to say too much about this approach, which we have explained in detail in Ref. \onlinecite{Qiu2017}.  The key is to note that the ODE for $W_n$ depends on $W_{n+1}$ which must be in some way approximated.  The simplest approach for a projected CCSD which relies on $W_0 - W_2$ is to neglect $W_3$ in solving the ODE; this results in the same $\mathcal{O}(N^6)$ scaling as conventional CC, and this method is known as SUCCSD(SD) (ODE2 in this paper).

To compare everything on even footing, we will this consider the simplest $\mathcal{O}(N^6)$ methods available to us.  In all cases, we retain only $U_1$ and $U_2$, and truncate $W = W_0 + W_1 + W_2$.  The simplest relevant order-by-order expansion uses $n=2$ and $n=3$ to give Ser2 and Ser3, while the ODE analog is ODE2.  Because we have retained only $U_1$ and $U_2$, the result we would like to obtain is PCCSD, but because we have eliminated $W_3$ and higher the best we can expect to do is what we have called Ser.  All calculations in this subsection are conducted in the half-filled 6-site Hubbard model with periodic boundary condition.

As shown in Figure \ref{Fig:HubbardTrunc}, PAV(ODE2) has excellent agreement with PAV(Ser) at small $U/t$ but the two differ substantially as $U/t$ grows (note that PAV(Ser) is indistinguishable from the exact result for small $U/t$).  In contrast, PAV(Ser2) and PAV(Ser3) differ significantly from PAV(Ser) at small $U/t$ but gradually approach it in the more strongly correlated limit.  In this small model problem, in other words, the truncated ODE and truncated series expansion behave very differently when we do not optimize the broken symmetry cluster operator.

On the other hand, the various VAP results are all broadly similar for all $U/t$ with small but non-negligible differences between them.  Only at $U/t \approx 8$ do the various methods differ significantly, where we recall that we have convergence difficulties (and note that here, Ser3 is close to the exact Ser result).

In order to see the difference between different methods in detail, we compare the $W$ amplitudes from every method. Unlike in Ref. \onlinecite{Qiu2017}, we focus on something closer to VAP. First we extract $U_1$ and $U_2$ from VAP(PCCSD) and with these fixed $U$ amplitudes (which we recall are the exact self-consistent $U$ amplitudes in projected CCSD) we calculate $W_0$, $W_1$ and $W_2$ from different approximate methods and compare them to the exact $W$ amplitudes corresponding to the given $U$ amplitudes. Figure \ref{Fig:4PAV} shows that Ser2, Ser3, and ODE2 all show relatively small error at $U/t=4$ but Ser3 performs better at large gauge angle.  However, for large $U/t$ as shown in Fig. \ref{Fig:20PAV}, the situation is somewhat different.  Here, we see that ODE2 and Ser2 have considerable error for large gauge angles, while Ser3 is relatively well behaved.  Taking the $U$ amplitudes from the `Ser' result which optimizes them disregarding $W_3$ and higher yields essentially the same behavior (data not shown).

\begin{figure}
\includegraphics[width=\columnwidth]{10_6.eps}
\caption{Spin-projected CCSD results in  the 6-electron 10-site Hubbard model.
\label{Fig:DopedHubbard}}
\end{figure}

The ODE- and series expansion approaches seem in a way to be complementary.  When the correlation is not too strong, they perform about equally well.  For stronger correlation atop PHF, where we expect the $U$ amplitudes to be larger, we would expect the series expansion approach to be less successful.  One can see this by considering the doped Hubbard model in Fig. \ref{Fig:DopedHubbard}.  In this case, the PHF method has relative large error and UCCSD is much better. Although for small $U/t$, the two approaches show similar results, our series expansion-based approach fails to converge for $U/t \gtrsim 5$.  The ODE-based approaches, in contrast, work properly.  On the other hand, the ODE-based approach does not readily extend to discrete symmetries where the projection operator is not written as an integral, but our series expansion technique requires no modification for these cases.

\section{Discussion and Conclusion}
\subsection{Discussion}

This work shows an alternative approach to the disentangled cluster approximation, without changing the basic framework established in Ref. \onlinecite{Qiu2017}.  The technique thus shares properties, desirable and undesirable, with this previous work.  It is easy to check that our approach is invariant to occupied-occupied and virtual-virtual rotation.  When the symmetry is not broken, $V_1$ will be zero and the theory goes back to traditional CCSD in which the equations truncate at $\mathcal{O}(U_2^2)$.

On the other hand, the theory is not fully extensive, a drawback shared with projected Hartree-Fock.  Only connected terms in $W$ contribute to the results at each gauge angle, but the final result is a sum over contributions from different gauge angles.  The upshot is that the size extensive component of PHF is the broken-symmetry mean-field energy and presumably the size-extensive component of PCC is the broken-symmetry coupled cluster energy.  Note that the PHF and PCC \textit{wave functions} in the thermodynamic limit differ from their broken-symmetry counterparts, but the energetic difference per particle between the projected and unprojected methods vanishes in the limit of large particle number.

Finally, as has been discussed elsewhere \cite{Qiu2018,Tsuchimochi2018} there is a problem with what we refer to as gauge modes.  Briefly, certain linear combinations of residuals vanish independent of the $U$ amplitudes, simply by virtue of the projection operator.  Essentially, only those components of the broken symmetry cluster operator needed for correlation have physical significance, while those components needed to restore symmetry are rendered irrelevant by the projector.  The practical consequence of this difficulty is that projected CC can be somewhat sensitive to the choice of initial guess; choosing different initial guesses can lead to fluctuations in the energy, as shown in Table \ref{Table:HF}.
\begin{table}
\caption{Total energies in the dissociation of HF (Hartree) with two different initial guesses for the $U$ amplitudes.\label{Table:HF}}

\begin{ruledtabular}
\begin{tabular}{lcc}
  & \multicolumn{2}{c}{Initial Guess}  \\
$R_\mathrm{HF}$ (Bohr)  & UCCSD   & Zero \\
\hline
3.5     &   -100.06248  & -100.06253    \\
5.0     &   -100.03054  &   -100.03057  \\
\end{tabular}
\end{ruledtabular}
\end{table}
While these fluctuations are usually small, they are difficult to eliminate. This linear dependence arising from the gauge modes can also cause convergence difficulties, particularly in the re-coupling region.  It is a good choice to start from some limit in which the solutions are well-defined and use the solution from a previous calculation as a new initial guess to step towards the region in which we are interested. We do not yet have an entirely satisfactory and comprehensive solution to this issue.

\subsection{Conclusion}
Solving strongly-correlated problems requires taking both strong and weak correlations into consideration.  Coupled cluster theory has proven to be an effective theory for weak dynamic correlation, but fails for strongly-correlated problems.  Frequently, however, these strong correlations can be taking into account at the mean-field level through the use of symmetry breaking and restoration.  It seems natural to try to combine PHF with post-Hartree--Fock methods by symmetry-projecting broken-symmetry correlated wave functions, but this is not always straightforward, and is particularly challenging for coupled cluster theory since the exponential nature of the wave function means it contains the full combinatorial number of excitations out of the broken-symmetry mean-field reference despite having a polynomial number of parameters.  In practice one must therefore approximate the projected CC state.

Our preferred disentangled cluster formalism means that the rotated CC wave functions $\mathrm{e}^{W(\theta)} |0\rangle$ to be summed over have the same structure as does the parent broken-symmetry CC state.  That is, they contain all possible excitations, and the cluster operator describing them is intrinsically of the same form as the full CC cluster operator.  By truncating the disentangled cluster operator to some low order, we can readily evaluate the required matrix elements.  In this work, we have shown that one can obtain fairly reliable disentangled cluster operators simply by equating the power series expansion of the rotated coupled cluster wave function to the configuration interaction expansion of the disentangled CC state; in other words, by solving
\begin{equation}
e^{W(\theta)} |0\rangle = R(\theta) \, \sum_{k=0}^n \frac{1}{k!} \, U^k |0\rangle.
\end{equation}
Although this approach might seem to break down when $R(\theta)$ is in some sense large, we have seen that in practice this is not too great a concern, particularly if one optimizes the broken-symmetry cluster operator $U$ in the presence of the projector.

This power series expansion technique complements the ODE-based approach we have used in previous work, and in fact seems to suggest a sort of hybrid technique.  The series expansion gives the (truncated) disentangled cluster operator \textit{exactly} through a given order in $U$, but does not contain any contributions from higher-order terms.  The ODE contains terms from all orders in $U$ but does not give the exact low-order result.  One might be tempted to thus use the series expansion to obtain $W$ through a given order in $U$ and subsequently correct it via the ODE-based formalism to ameliorate the truncation error.

Regardless of how one chooses to approximate the projected CC wave function, energy, and amplitude equations, however, it seems clear to us that projected CC methods have the potential to provide highly accurate results for a wide variety of weakly- and strongly-correlated problems, and the chief difficulty lies in writing sufficiently efficient code and in choosing sufficiently important symmetries to project.

\section{Data Availability}
The data that support the findings of this study are available from the corresponding author upon reasonable request.

\begin{acknowledgments}
This work was supported by the U.S. National Science Foundation under Grant CHE-1762320. G.E.S. is a Welch Foundation Chair (C-0036).  We thank Yiheng Qiu, Guo Chen and Gaurav Harsha for helpful discussion.
\end{acknowledgments}


The boys & their toys... together at the Cruise at the Beach car show in Redondo Beach. It was such a blast to be here and to see all the attention both cars generated. And they both placed in the TOP 5 of the night!!
Steve's 1965 Ford Falcon Sedan Delivery "Surfbird" Goose's 1952 Henry J "Hemi J"
Click on a photo to open in a gallery view!


text:
Hartmut Strenger
Kapitänleutnant (Crew 37b)
Born 11 Mar 1918 Crossen
Died 26 Mar 1978 (60)
9 Oct 1937 Offiziersanwärter
28 Jun 1938 Seekadett
1 Apr 1939 Fähnrich zur See
1 Mar 1940 Oberfähnrich zur See
1 May 1940 Leutnant zur See
1 Apr 1942 Oberleutnant zur See
1 Jan 1945 Kapitänleutnant
U-966 4 Mar 1943 10 Nov 1943 1 patrol (37 days)
Eckehard wolf had graduated from Kriegsmarine promotion 1937b. Between March an October 1941 served as third officer in the U560, then became a second officer until July 1942. From August 1942 to March 1943 followed a few courses in the "8 K.L.A." and served aboard the U-459. March 4, took over the U-966. Kiel receive the ship wich was to be his emblem "Gut Holz", recalling the words spoken by the Commander to the seafaring in his introduction. Having sunk his boat in Cape Ortegal, Wolf and all the uboat crew was retained in Naval Station La Graña in Ferrol in December, 22 1943.
On September 12 1944 Wolf was suffering from a lung ailment, the Authorities gave a save passage to travel to Madrid, where he was was treated at the military hospital. Official documents indicated Wolf died there. But the reality was very different. A Lufthansa plane destined for Hamburg was carrying a passenger named Erich Weber, who was Eckehard Wolf. He was promoted to Kapitanleutnant and given command of a company of Marines to defend Hamburg the Allied troops.
After the war Wolf married and had two children. Years later he returned to "O Barqueiro" (Cape Ortegal), accompanied by his wife Anneliese. The visit was repeated many summers. So many that one of his sons ended marrying with a girl from O Barqueiro. In the summer of 1978 Eckehard Wolf dies. His last will and testament was to be cremated and thrown into the sea where the U-966 lies.
Patrol info for Eckehard Wolf
1. U-966 9 Sep 1943 Kiel 15 Sep 1943 Molde 7 days
2. U-966 17 Sep 1943 Molde 18 Sep 1943 Trondheim 2 days
3. U-966 5 Oct 1943 Trondheim 10 Nov 1943 Sunk Patrol 1, 37 days
About ranks and decorations
Ranks shown in italics are our database inserts based on the rank dates of his crew comrades. The officers of each crew would normally have progressed through the lower ranks at the same rate.

redpajama_set_name: RedPajamaCommonCrawl


Building Design + Construction has compiled the Top 101 products of 2017, including the Marvin Ultimate Bi-Fold Door. A simple, elegant solution for indoor/outdoor living, the Marvin Ultimate Bi-Fold Door offers bigger sizes with more glass and a clean design aesthetic. Spanning 55 feet in width, the Ultimate Bi-Fold Door is one of the widest panel doors in the industry.
Read more in the digital edition of Building Design + Construction.


Florida Cancer Specialists and Research Institute is a Fort Myers, FL-based company in the Healthcare, Pharmaceuticals, and Biotech sector.
Joyce Nelson is Chief Human Resources Officer at Florida Cancer Specialists and Research Institute. Previously, Joyce held various senior HR leadership roles in the industry.


If you are using Safari to view this page, we are aware that there are some issues. We apologise for the inconvenience, and would recommend that you use an alternative browser like Google Chrome or Firefox.
© Systematic Innovation 2017. All rights reserved.


UK Connect are the UK's leading provider of communication solutions to the construction industry. They had already approached us to develop some advertising, but also needed more professional collateral.
We designed and wrote the copy for two new brochures and produced them in both print and also digital versions to use for prospecting and promotions.


text:
Cross-Buttock, Hank and Hipe
Miranda Vane
'There are people,' Roland Barthes wrote, 'who think that wrestling is an ignoble sport.' It is possible that those who put together the recent successful nomination to make the Lake District a Unesco World Heritage Site are just such people. The bid made much of the paintings and poems inspired by the landscape, but gave little attention to Cumberland and Westmorland Wrestling, which was said by Sir Walter Armstrong in 1890 to be 'productive of the most unparalleled excitement in the Northern counties'.
A Thomas Bewick woodcut, thought to have been produced in 1776, shows two wrestlers engaged in the distinctive C&W back-hold, evidence that the sport has been practised in its current form since at least then, though wrestling had been popular across the region since long before. The most frequently occurring sport in medieval misericords, it is occasionally found carved into ninth-century Irish crosses. But some people argue that it is a legacy of Viking invaders, like many local place names and the particularities of Cumbrian dialects.
A 1656 edict from Oliver Cromwell's Associated Ministers and Churches of the Counties of Cumberland and Westmorland includes wrestling on a list of sinful amusements that would lead to any perpetrator being 'suspended from the Sacrament of the Lord's Supper'. Prohibition failed but moral concern about wrestling endured. Professor John Wilson, writing under the pen name Christopher North in Blackwood's Magazine in December 1823, voiced his consternation that such was the mania for wrestling, 'we fear it is thought of even in church.' History doesn't relate if this was a problem for Rev. Osborne Littledale, an early 19th-century curate of Buttermere, who once took first place in the wrestling at the Crab Tree sports in Egremont; his clerk came first in the fell running. The Rev. Abraham Brown, another noted clerical champion, was said in 1823 to be the first C&W wrestler 'of whom we have authentic records of excellency as a "buttocker"'.
Buttocking is a 'chip' (as C&W moves are known) in which a wrestler 'grasses' his opponent by getting his back under his stomach and throwing him over his head. A bout begins with wrestlers 'tekking hod': clasping their hands around one another's back, chins resting on each other's right shoulder. Once the contest is underway, a wrestler, without breaking their hold, may employ any of a number of chips to fell their adversary; the less showy cross-buttock, or the 'barbarous and unscientific' hank, or the swinging hipe.
The traditional C&W strip (an anachronistic remnant of 1860s sporting fashion) consists of vest, leggings and stockinged feet, with velvet briefs worn outside of the leggings, Superman-style. It is customary for the outfits to be embroidered with flowers, birds and butterflies, and in many tournaments the wrestling is preceded by a costume competition.
William Wordsworth wasn't a fan. Writing to protest against the opening of the Kendal to Windermere railway, he complained that wrestling was devised by the directors of railway companies to lure 'the imperfectly educated classes' to travel by train to the Lakes, only to be parted from their meagre wages by frivolous distractions.
Charles Dickens, however, was rather taken with the sport. He found watching wrestling in the saw-dust circles and gas lights of St John's Wood 'wearisome to the last degree', but was so captivated by 'the vigour of sinew, the shifts of suppleness' at the Ferry Ring on Windermere that he took a lesson with the 1858 champion, 'Bonnie' Longmire. His schooling, which took place in the wrestler's garden, 'has left [its] mark indelibly in our back', he wrote in Household Words, 'besides having compressed our ribs so that we cannot breathe right yet'.
C&W wrestling is no longer as popular as it once was. A coach recently said that he was losing his protégés to the lure of 'prosperity and a fine career south of the Watford Gap'. Leaving home did not always preclude a wrestling career. From 1824, the now defunct C&W Wrestling Society would meet on Kennington Common on Good Friday. It doesn't seem to have caught on with Londoners. An article in the Pall Mall Gazette in 1864 reporting on a C&W wrestling match at the Agricultural Hall in Islington noted with suspicion the 'infusion of provincial gentlemen with a marked North Country accent', smoking inferior tobacco and betting with 'an unnecessary amount of vociferation'.
Shortly before the general election of 1820, Wilson wrote in Blackwood's, a friend of his returned home to London from Cumberland perplexed that, as far as he could establish, the county was not to be contested by Lord Lowther and Henry Brougham as it was widely understood in London, but by Thomas Ford of Egremont, and William Richardson of Caldbeck, 'men of no landed property and probably Radicals'. In the event, Viscount Lowther retained his seat and William Richardson, a legendary wrestler of 14 stone, won the great annual wrestling contest at Carlisle.
wrestling history Lake District sport
Platypuses do it differently
Liam Shaw
Of all the mammals, the naturalist George Shaw (no relation) wrote when he first described it in 1799, the platypus 'seems the most extraordinary in...
The Seine Also Rises
Chris Newens
For several days now, the Seine has been drawing a crowd. The international press, tourists and Parisians have come to look at the river because it...
At the US Embassy
Duncan Wilkins
'Reason I canceled my trip to London,' Donald Trump tweeted last month, 'is that I am not a big fan of the Obama Administration having sold...


The MND research blog aims to provide you with up-to-date information on the research development team's activities as well as exciting news on MND research. You can view this information anytime by clicking on the 'How to use this blog' tab in the top right hand corner.
The word 'blog' stands for 'web log' and is effectively an online diary where someone can record their thoughts or comments on a particular story/event. The MND research blog is written by the research development team to provide you with updates and comments on recent MND research.
You can get updates from this blog, or email alerts, to let you know when a new blog post has been posted. This is known as 'subscribing' to a blog and it enables you to view a blog post straight from your email. To subscribe enter your email address in the box 'Stay in Touch' on the right hand side of the blog below. Once you have entered your email address click on the 'Sign me up!' button, which will then add your email address to our MND research blog mailing list.
You will recieve an email asking you to confirm that you wish to subscribe to this blog. Once confirmed you will recieve email alerts of new blog posts directly to your inbox.
You can also subscribe to an RSS feed of this blog by clicking on the RSS feeds posts or comments buttons on the right hand side. An RSS feed is the same as subscribing to the blog except you do not need an email address.
I know I read it somewhere..
You can view our blog articles using the 'archive' or 'categories' drop down boxes on the right hand side of the blog. This can allow you to view all blog posts only on a particular theme (category) or during a particular time frame (archives).
Our 'tag cloud' on the left hand side of the blog contains a list of commonly used keywords. By clicking on a keyword (eg BioMOx) you can view all blog posts that mention that particular keyword.
From the homepage you can view an individual blog post by clicking on the title. At the end of each blog post there is an option to rate or share the post by means of social media (eg Facebook and Twitter). By clicking on the appropriate sharing option you can then share the blog post with your friends.
blogging, how to use a blog, How to use this blog, mnd research blog, Samantha Price, what is a blog?


text:
<?php

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

class acp_permission_roles
{
	var $u_action;
	protected $auth_admin;

	function main($id, $mode)
	{
		global $db, $user, $auth, $template, $cache, $phpbb_container;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		global $request;

		if (!function_exists('user_get_id_name'))
		{
			include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
		}

		if (!class_exists('auth_admin'))
		{
			include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
		}

		$this->auth_admin = new auth_admin();

		$user->add_lang('acp/permissions');
		add_permission_language();

		$this->tpl_name = 'acp_permission_roles';

		$submit = (isset($_POST['submit'])) ? true : false;
		$role_id = request_var('role_id', 0);
		$action = request_var('action', '');
		$action = (isset($_POST['add'])) ? 'add' : $action;

		$form_name = 'acp_permissions';
		add_form_key($form_name);

		if (!$role_id && in_array($action, array('remove', 'edit', 'move_up', 'move_down')))
		{
			trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
		}

		switch ($mode)
		{
			case 'admin_roles':
				$permission_type = 'a_';
				$this->page_title = 'ACP_ADMIN_ROLES';
			break;

			case 'user_roles':
				$permission_type = 'u_';
				$this->page_title = 'ACP_USER_ROLES';
			break;

			case 'mod_roles':
				$permission_type = 'm_';
				$this->page_title = 'ACP_MOD_ROLES';
			break;

			case 'forum_roles':
				$permission_type = 'f_';
				$this->page_title = 'ACP_FORUM_ROLES';
			break;

			default:
				trigger_error('NO_MODE', E_USER_ERROR);
			break;
		}

		$template->assign_vars(array(
			'L_TITLE'		=> $user->lang[$this->page_title],
			'L_EXPLAIN'		=> $user->lang[$this->page_title . '_EXPLAIN'])
		);

		// Take action... admin submitted something
		if ($submit || $action == 'remove')
		{
			switch ($action)
			{
				case 'remove':

					$sql = 'SELECT *
						FROM ' . ACL_ROLES_TABLE . '
						WHERE role_id = ' . $role_id;
					$result = $db->sql_query($sql);
					$role_row = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);

					if (!$role_row)
					{
						trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
					}

					if (confirm_box(true))
					{
						$this->remove_role($role_id, $permission_type);

						$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
						add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_REMOVED', $role_name);
						trigger_error($user->lang['ROLE_DELETED'] . adm_back_link($this->u_action));
					}
					else
					{
						confirm_box(false, 'DELETE_ROLE', build_hidden_fields(array(
							'i'			=> $id,
							'mode'		=> $mode,
							'role_id'	=> $role_id,
							'action'	=> $action,
						)));
					}

				break;

				case 'edit':

					// Get role we edit
					$sql = 'SELECT *
						FROM ' . ACL_ROLES_TABLE . '
						WHERE role_id = ' . $role_id;
					$result = $db->sql_query($sql);
					$role_row = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);

					if (!$role_row)
					{
						trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
					}

				// no break;

				case 'add':

					if (!check_form_key($form_name))
					{
						trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
					}

					$role_name = utf8_normalize_nfc(request_var('role_name', '', true));
					$role_description = utf8_normalize_nfc(request_var('role_description', '', true));
					$auth_settings = request_var('setting', array('' => 0));

					if (!$role_name)
					{
						trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
					}

					if (utf8_strlen($role_description) > 4000)
					{
						trigger_error($user->lang['ROLE_DESCRIPTION_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
					}

					// if we add/edit a role we check the name to be unique among the settings...
					$sql = 'SELECT role_id
						FROM ' . ACL_ROLES_TABLE . "
						WHERE role_type = '" . $db->sql_escape($permission_type) . "'
							AND role_name = '" . $db->sql_escape($role_name) . "'";
					$result = $db->sql_query($sql);
					$row = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);

					// Make sure we only print out the error if we add the role or change it's name
					if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name)))
					{
						trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING);
					}

					$sql_ary = array(
						'role_name'			=> (string) $role_name,
						'role_description'	=> (string) $role_description,
						'role_type'			=> (string) $permission_type,
					);

					if ($action == 'edit')
					{
						$sql = 'UPDATE ' . ACL_ROLES_TABLE . '
							SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
							WHERE role_id = ' . $role_id;
						$db->sql_query($sql);
					}
					else
					{
						// Get maximum role order for inserting a new role...
						$sql = 'SELECT MAX(role_order) as max_order
							FROM ' . ACL_ROLES_TABLE . "
							WHERE role_type = '" . $db->sql_escape($permission_type) . "'";
						$result = $db->sql_query($sql);
						$max_order = (int) $db->sql_fetchfield('max_order');
						$db->sql_freeresult($result);

						$sql_ary['role_order'] = $max_order + 1;

						$sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
						$db->sql_query($sql);

						$role_id = $db->sql_nextid();
					}

					// Now add the auth settings
					$this->auth_admin->acl_set_role($role_id, $auth_settings);

					$role_name = (!empty($user->lang[$role_name])) ? $user->lang[$role_name] : $role_name;
					add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_' . strtoupper($action), $role_name);

					trigger_error($user->lang['ROLE_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action));

				break;
			}
		}

		// Display screens
		switch ($action)
		{
			case 'add':

				$options_from = request_var('options_from', 0);

				$role_row = array(
					'role_name'			=> utf8_normalize_nfc(request_var('role_name', '', true)),
					'role_description'	=> utf8_normalize_nfc(request_var('role_description', '', true)),
					'role_type'			=> $permission_type,
				);

				if ($options_from)
				{
					$sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option
						FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o
						WHERE o.auth_option_id = p.auth_option_id
							AND p.role_id = ' . $options_from . '
						ORDER BY p.auth_option_id';
					$result = $db->sql_query($sql);

					$auth_options = array();
					while ($row = $db->sql_fetchrow($result))
					{
						$auth_options[$row['auth_option']] = $row['auth_setting'];
					}
					$db->sql_freeresult($result);
				}
				else
				{
					$sql = 'SELECT auth_option_id, auth_option
						FROM ' . ACL_OPTIONS_TABLE . "
						WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
							AND auth_option <> '{$permission_type}'
						ORDER BY auth_option_id";
					$result = $db->sql_query($sql);

					$auth_options = array();
					while ($row = $db->sql_fetchrow($result))
					{
						$auth_options[$row['auth_option']] = ACL_NO;
					}
					$db->sql_freeresult($result);
				}

			// no break;

			case 'edit':

				if ($action == 'edit')
				{
					$sql = 'SELECT *
						FROM ' . ACL_ROLES_TABLE . '
						WHERE role_id = ' . $role_id;
					$result = $db->sql_query($sql);
					$role_row = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);

					$sql = 'SELECT p.auth_option_id, p.auth_setting, o.auth_option
						FROM ' . ACL_ROLES_DATA_TABLE . ' p, ' . ACL_OPTIONS_TABLE . ' o
						WHERE o.auth_option_id = p.auth_option_id
							AND p.role_id = ' . $role_id . '
						ORDER BY p.auth_option_id';
					$result = $db->sql_query($sql);

					$auth_options = array();
					while ($row = $db->sql_fetchrow($result))
					{
						$auth_options[$row['auth_option']] = $row['auth_setting'];
					}
					$db->sql_freeresult($result);
				}

				if (!$role_row)
				{
					trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
				}

				$phpbb_permissions = $phpbb_container->get('acl.permissions');

				$template->assign_vars(array(
					'S_EDIT'			=> true,

					'U_ACTION'			=> $this->u_action . "&action={$action}&role_id={$role_id}",
					'U_BACK'			=> $this->u_action,

					'ROLE_NAME'			=> $role_row['role_name'],
					'ROLE_DESCRIPTION'	=> $role_row['role_description'],
					'L_ACL_TYPE'		=> $phpbb_permissions->get_type_lang($permission_type),
				));

				// We need to fill the auth options array with ACL_NO options ;)
				$sql = 'SELECT auth_option_id, auth_option
					FROM ' . ACL_OPTIONS_TABLE . "
					WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
						AND auth_option <> '{$permission_type}'
					ORDER BY auth_option_id";
				$result = $db->sql_query($sql);

				while ($row = $db->sql_fetchrow($result))
				{
					if (!isset($auth_options[$row['auth_option']]))
					{
						$auth_options[$row['auth_option']] = ACL_NO;
					}
				}
				$db->sql_freeresult($result);

				// Unset global permission option
				unset($auth_options[$permission_type]);

				// Display auth options
				$this->display_auth_options($auth_options);

				// Get users/groups/forums using this preset...
				if ($action == 'edit')
				{
					$hold_ary = $this->auth_admin->get_role_mask($role_id);

					if (sizeof($hold_ary))
					{
						$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];

						$template->assign_vars(array(
							'S_DISPLAY_ROLE_MASK'	=> true,
							'L_ROLE_ASSIGNED_TO'	=> sprintf($user->lang['ROLE_ASSIGNED_TO'], $role_name))
						);

						$this->auth_admin->display_role_mask($hold_ary);
					}
				}

				return;
			break;

			case 'move_up':
			case 'move_down':

				if (!check_link_hash($request->variable('hash', ''), 'acp_permission_roles'))
				{
					trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
				}

				$sql = 'SELECT role_order
					FROM ' . ACL_ROLES_TABLE . "
					WHERE role_id = $role_id";
				$result = $db->sql_query($sql);
				$order = $db->sql_fetchfield('role_order');
				$db->sql_freeresult($result);

				if ($order === false || ($order == 0 && $action == 'move_up'))
				{
					break;
				}
				$order = (int) $order;
				$order_total = $order * 2 + (($action == 'move_up') ? -1 : 1);

				$sql = 'UPDATE ' . ACL_ROLES_TABLE . '
					SET role_order = ' . $order_total . " - role_order
					WHERE role_type = '" . $db->sql_escape($permission_type) . "'
						AND role_order IN ($order, " . (($action == 'move_up') ? $order - 1 : $order + 1) . ')';
				$db->sql_query($sql);

				if ($request->is_ajax())
				{
					$json_response = new \phpbb\json_response;
					$json_response->send(array(
						'success'	=> (bool) $db->sql_affectedrows(),
					));
				}

			break;
		}

		// By default, check that role_order is valid and fix it if necessary
		$sql = 'SELECT role_id, role_order
			FROM ' . ACL_ROLES_TABLE . "
			WHERE role_type = '" . $db->sql_escape($permission_type) . "'
			ORDER BY role_order ASC";
		$result = $db->sql_query($sql);

		if ($row = $db->sql_fetchrow($result))
		{
			$order = 0;
			do
			{
				$order++;
				if ($row['role_order'] != $order)
				{
					$db->sql_query('UPDATE ' . ACL_ROLES_TABLE . " SET role_order = $order WHERE role_id = {$row['role_id']}");
				}
			}
			while ($row = $db->sql_fetchrow($result));
		}
		$db->sql_freeresult($result);

		// Display assigned items?
		$display_item = request_var('display_item', 0);

		// Select existing roles
		$sql = 'SELECT *
			FROM ' . ACL_ROLES_TABLE . "
			WHERE role_type = '" . $db->sql_escape($permission_type) . "'
			ORDER BY role_order ASC";
		$result = $db->sql_query($sql);

		$s_role_options = '';
		while ($row = $db->sql_fetchrow($result))
		{
			$role_name = (!empty($user->lang[$row['role_name']])) ? $user->lang[$row['role_name']] : $row['role_name'];

			$template->assign_block_vars('roles', array(
				'ROLE_NAME'				=> $role_name,
				'ROLE_DESCRIPTION'		=> (!empty($user->lang[$row['role_description']])) ? $user->lang[$row['role_description']] : nl2br($row['role_description']),

				'U_EDIT'			=> $this->u_action . '&action=edit&role_id=' . $row['role_id'],
				'U_REMOVE'			=> $this->u_action . '&action=remove&role_id=' . $row['role_id'],
				'U_MOVE_UP'			=> $this->u_action . '&action=move_up&role_id=' . $row['role_id'] . '&hash=' . generate_link_hash('acp_permission_roles'),
				'U_MOVE_DOWN'		=> $this->u_action . '&action=move_down&role_id=' . $row['role_id'] . '&hash=' . generate_link_hash('acp_permission_roles'),
				'U_DISPLAY_ITEMS'	=> ($row['role_id'] == $display_item) ? '' : $this->u_action . '&display_item=' . $row['role_id'] . '#assigned_to')
			);

			$s_role_options .= '<option value="' . $row['role_id'] . '">' . $role_name . '</option>';

			if ($display_item == $row['role_id'])
			{
				$template->assign_vars(array(
					'L_ROLE_ASSIGNED_TO'	=> sprintf($user->lang['ROLE_ASSIGNED_TO'], $role_name))
				);
			}
		}
		$db->sql_freeresult($result);

		$template->assign_vars(array(
			'S_ROLE_OPTIONS'		=> $s_role_options)
		);

		if ($display_item)
		{
			$template->assign_vars(array(
				'S_DISPLAY_ROLE_MASK'	=> true)
			);

			$hold_ary = $this->auth_admin->get_role_mask($display_item);
			$this->auth_admin->display_role_mask($hold_ary);
		}
	}

	/**
	* Display permission settings able to be set
	*/
	function display_auth_options($auth_options)
	{
		global $template, $user, $phpbb_container;

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

		$content_array = $categories = array();
		$key_sort_array = array(0);
		$auth_options = array(0 => $auth_options);

		// Making use of auth_admin method here (we do not really want to change two similar code fragments)
		$this->auth_admin->build_permission_array($auth_options, $content_array, $categories, $key_sort_array);

		$content_array = $content_array[0];

		$template->assign_var('S_NUM_PERM_COLS', sizeof($categories));

		// Assign to template
		foreach ($content_array as $cat => $cat_array)
		{
			$template->assign_block_vars('auth', array(
				'CAT_NAME'	=> $phpbb_permissions->get_category_lang($cat),

				'S_YES'		=> ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
				'S_NEVER'	=> ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
				'S_NO'		=> ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false)
			);

			foreach ($cat_array['permissions'] as $permission => $allowed)
			{
				$template->assign_block_vars('auth.mask', array(
					'S_YES'		=> ($allowed == ACL_YES) ? true : false,
					'S_NEVER'	=> ($allowed == ACL_NEVER) ? true : false,
					'S_NO'		=> ($allowed == ACL_NO) ? true : false,

					'FIELD_NAME'	=> $permission,
					'PERMISSION'	=> $phpbb_permissions->get_permission_lang($permission),
				));
			}
		}
	}

	/**
	* Remove role
	*/
	function remove_role($role_id, $permission_type)
	{
		global $db;

		// Get complete auth array
		$sql = 'SELECT auth_option, auth_option_id
			FROM ' . ACL_OPTIONS_TABLE . "
			WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
		$result = $db->sql_query($sql);

		$auth_settings = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$auth_settings[$row['auth_option']] = ACL_NO;
		}
		$db->sql_freeresult($result);

		// Get the role auth settings we need to re-set...
		$sql = 'SELECT o.auth_option, r.auth_setting
			FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o
			WHERE o.auth_option_id = r.auth_option_id
				AND r.role_id = ' . $role_id;
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$auth_settings[$row['auth_option']] = $row['auth_setting'];
		}
		$db->sql_freeresult($result);

		// Get role assignments
		$hold_ary = $this->auth_admin->get_role_mask($role_id);

		// Re-assign permissions
		foreach ($hold_ary as $forum_id => $forum_ary)
		{
			if (isset($forum_ary['users']))
			{
				$this->auth_admin->acl_set('user', $forum_id, $forum_ary['users'], $auth_settings, 0, false);
			}

			if (isset($forum_ary['groups']))
			{
				$this->auth_admin->acl_set('group', $forum_id, $forum_ary['groups'], $auth_settings, 0, false);
			}
		}

		// Remove role from users and groups just to be sure (happens through acl_set)
		$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
			WHERE auth_role_id = ' . $role_id;
		$db->sql_query($sql);

		$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
			WHERE auth_role_id = ' . $role_id;
		$db->sql_query($sql);

		// Remove role data and role
		$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
			WHERE role_id = ' . $role_id;
		$db->sql_query($sql);

		$sql = 'DELETE FROM ' . ACL_ROLES_TABLE . '
			WHERE role_id = ' . $role_id;
		$db->sql_query($sql);

		$this->auth_admin->acl_clear_prefetch();
	}
}

redpajama_set_name: RedPajamaGithub


text:
Q: How to remove duplicates of inner query that was used to remove duplicates in SQL? This is a SQL Server question, so here are the tables I am working with (note: column NAME is the name of the code set):
Table: CODE SET
CODE_SET_ID  | NAME
-------------+-----------
1            | JACKETS
2            | PANTS
3            | SHIRTS

Table: CODE SET DETAIL
CODE           | DESCRIPTION    | CODE_SET_ID
---------------+----------------+------------
BLUE           | BLUE JACKET    | 1
BLUE           | BLUE JACKET    | 1
GREEN          | GREEN JACKET   | 1
GREEN          | GREEN JACKET   | 1
PURPLE         | PURPLE JACKET  | 1

The query I wrote currently finds all duplicate code set codes and which code set those code set codes belong too. The following query would return
JACKETS, BLUE,  2
JACKETS, GREEN, 2

How would I wrap another query around the following query so that I only get JACKETS?
SELECT
    bcs.NAME, bcsd.CODE, bcsd.DESCRIPTION, COUNT(*)
FROM
    CODE_SET_DETAIL as bcsd
INNER JOIN
    CODE_SET as bcs ON bcsd.CODE_SET_ID = bcs.CODE_SET_ID
GROUP BY
    bcs.NAME, bcsd.CODE, bcsd.DESCRIPTION
HAVING
    COUNT(*) > 1

So far, I've tried using WHERE EXISTS, yet the result set does not look correct.

A: WITH X (Name, Code, Description, DetailCount) AS (
    SELECT bcs.NAME, bcsd.CODE, bcsd.DESCRIPTION, COUNT(*)
    FROM CODE_SET_DETAIL as bcsd
    INNER JOIN CODE_SET as bcs
    ON bcsd.CODE_SET_ID = bcs.CODE_SET_ID
    GROUP BY bcs.NAME, bcsd.CODE, bcsd.DESCRIPTION
    HAVING COUNT(*) > 1
)
SELECT DISTINCT Name
FROM X

A: If you really want only the "jackets" value, why don't you add " bcs.name='jackets' " to your HAVING clause and skip the whole outer query, or am I missing something?

redpajama_set_name: RedPajamaStackExchange


text:
Palace est une comédie dramatique française, réalisée par Édouard Molinaro en 1984, et sortie le .

Synopsis
1944. Lucien Molard, combattant dans les Forces Françaises Libres, aux côtés des armées alliées, est fait prisonnier par les Allemands et, dans le stalag où il est envoyé, il retrouve son frère. Celui-ci, devenu pianiste dans un palace, bénéficie d'une petite vie presque confortable et des charmes de la directrice Hanna. Lucien, choqué, cherche à convaincre son frère de s'enfuir de ce camp mais ce dernier est bien décidé à rester...

Fiche technique
 Réalisation : Édouard Molinaro
 Scénario : Alain Godard, Édouard Molinaro
 Dialogues : Alain Godard
 Producteurs : Jean-Pierre Labrande, Frank Lipsik, Jean-Jacques Vuillermin, Peter Hahne
 Musique : Michel Legrand
 Costumes : Jacques Cottin
 Tournage : 1984
 Pays :
 Durée : 90 minutes
 Genre : comédie dramatique
 Date de sortie :
 Affiche : Yves Thos

Distribution
 Daniel Auteuil : Lucien Molard
 Claude Brasseur : Robert Molard
 Gudrun Landgrebe : Hannah Bauer
 Jean-Pierre Castaldi : Le cuisinier
 Jean-Michel Dupuis : Le serveur

Liens externes

Film français sorti en 1985
Comédie dramatique française
Film réalisé par Édouard Molinaro
Film avec une musique composée par Michel Legrand
Film tourné dans le Morbihan
Film tourné dans l'Essonne

redpajama_set_name: RedPajamaWikipedia


text:
SUB-SAHARAN AFRICA: Implications of Kenya's DSSI accession
Malte Liewerscheidt
Politics, Africa, Emerging Markets, Kenya
On 11 January, the Paris Club announced that Kenya would benefit from the Debt Service Suspension Initiative (DSSI) from 1 January to 30 June 2021. At the start of a crucial year in Kenya's political cycle, the government's U-turn on an earlier decision not to participate in the initiative does not bode well for the state of public finances. While Kenya has committed to seeking a similar debt service suspension from its other bilateral official creditors, most notably China, this obligation does not extend to its private creditors. Kenya's decision to join the scheme after all may raise
SUB-SAHARAN AFRICA: G20 debt moratorium initiative slowly gathering pace
KENYA: Al-Shabaab's impact on the economic and fiscal outlook
SUB-SAHARAN AFRICA: Zambia – trendsetter or outlier in debt relief debate?
SUB-SAHARAN AFRICA: The African Union's push for debt restructuring
CHINA: Beijing may resist G20's Common Framework for debt reduction
More by Malte Liewerscheidt
NIGERIA: Covid-19 challenges abound
( 4 mins read ) Nigeria faces a second wave of Covid-19 infections, with a steady surge since December 2020. The government is hesitant to reintroduce restrictions on movement that proved hugely unpopular and were in fact widely ignored in
GHANA: Hung parliament will necessitate compromise
( 3 mins read ) On 7 January, President-elect Nana Akufo-Addo will officially commence his second term in office following the inauguration of the new parliament the same day. The ruling New Patriotic Party's (NPP) wafer-thin majority will be put
GHANA: President's narrow victory raises specter of legal challenge
( 3 mins read ) In the evening of 9 December, the Electoral Commission of Ghana (EC) declared President Nana Akufo-Addo the winner of Monday's presidential election with 51.3% of valid votes cast, against 47.4% cast in favor of his
GHANA: President Akufo-Addo remains the frontrunner
( 3 mins read ) President Nana Akufo-Addo and his New Patriotic Party (NPP) are the frontrunners in the 7 December general elections. While the few reliable polls available all indicate that Akufo-Addo has a strong lead over John Mahama,
ETHIOPIA: Abiy takes Mekelle, but can he win the peace?
( 3 mins read ) Prime Minister Abiy Ahmed has announced what could be game-changing events in the one month-old conflictwith the Tigray regional leadership. Over the weekend, Abiy announced that the Ethiopian National Defense Force (ENDF) had taken control of
NIGERIA: Massacre attributed to Boko Haram does not alter strategic outlook
( 2 mins read ) On 28 November, at least 110 civilians have reportedly been killed by armed men in a village close to Maiduguri, the capital of north-eastern Borno state. The style of the attack, which was apparently carried
KENYA: Political incentives remain juxtaposed to budget consolidation
( 5 mins read ) Controversial constitutional amendments proffered with the Building Bridges Initiative (BBI) will necessitate a public referendum by mid-2021. The referendum will effectively be a high-stakes test-run for the presidential election slated for August 2022. The political
GHANA: Anti-corruption czar's resignation unlikely to turn the tide
( 3 mins read ) With less than three weeks to go before the 7 December general elections, the resignation of Special Prosecutor Martin Amidu on 16 November is a major blow for President Nana Akufo-Addo and his New Patriotic
SUB-SAHARAN AFRICA: China, private sector partake in future debt restructurings
( 3 mins read ) Press play to listen On 13 November, the G20 published the anticipated 'Common Framework for Debt Treatments beyond the Debt Service Suspension Initiative (DSSI)'. In what may be read as a concession to get China on
GHANA: The state of the race
Speevr Moderator November 12, 2020
( 4 mins read ) President Nana Akufo-Addo and his New Patriotic Party (NPP) remain the frontrunners in presidential and parliamentary elections scheduled for 7 December. If defeated, the opposition National Democratic Congress (NDC) of John Mahama may challenge the
COTE D'IVOIRE: Violent escalation averted, problems remain
Teneo November 6, 2020
( 3 mins read ) While the post-election stand-off between the opposition and the government continues, the risk of a violent escalation appears to have largely subsided for now. Neither the ongoing house arrest of key opposition leaders, nor an open appeal
COTE D'IVOIRE: Ouattara declared winner, opposition to form counter-government
( 3 mins read ) In the early hours of 3 November, the Independent Electoral Commission (CEI) declared President Alassane Ouattara the winner of the 31 October presidential election, with 94.3% of votes cast, amid an official turnout of 53.9%.


This is the follow-up to the cult Japanese draping book "Drape Drape" and the latest in the new series from Bunka Fashion College. It includes 14 stylish contemporary designs for tops, dresses, skirts, vests and jackets, with easy-to-follow step-by-step instructions and diagrams that skillfully guide the reader through the draping process. With two full-scale patterns at the back, this book provides exciting design ideas and highly practical techniques for readers looking to continue exploring the art of draping.


In honor of its 75th anniversary, American fashion house Coach has teamed up with Disney to launch a limited edition Mickey Mouse collection.
The result is an awesome partnership between two iconic brands with a playful spin on the classics. Disney animators created sketches for Coach, with exclusive artwork appearing on a range of Coach's signature pieces: bags, backpacks, leather jackets, tees, charms, wallets, key chains, luggage tags, and sneakers. Collectible pieces like oversized black leather Mickey dolls and shearling beanbags complete the offering.
Join the #DisneyxCoach club and check out our favorite pieces in the photo gallery. Bonus: if you click the little "i" button at the bottom of each photo, you can shop the Disney x Coach 1941 items in the story.


text:
Un drept inalienabil este un drept atașat direct persoanei în funcție de cine este; un drept inalienabil este un drept inerent unui individ pur și simplu din cauza a ceea ce este și, prin urmare, din cauza condiției sale umane. Dar există și drepturi inalienabile atașate unei persoane din cauza calităților sale sau a poziției pe care o ocupă în societate. Prin urmare, o persoană nu se poate separa de drepturile sale inalienabile, chiar dacă dorește să facă acest lucru. În schimb, un drept care poate fi atribuit, transferat sau vândut este un drept alienabil.

De exemplu, o persoană nu poate renunța la libertatea sa în beneficiul altei persoane (sclavie), este un drept inalienabil. Drepturile omului sunt drepturi inalienabile și sunt reunite în Declarația Universală a Drepturilor Omului (DUDH). Pe de altă parte, o persoană își poate transfera sau vinde dreptul de proprietate, este vorba despre un drept alienabil. Cu toate acestea, există câteva excepții. Astfel, dreptul la libertate poate fi limitat pentru o persoană condamnată pentru infracțiuni de către o instanță.

Definiție
David Ellerman definește dreptul inalienabil după cum urmează: este un drept care se atașează unui individ din cauza a ceea ce satisface o anumită calitate sau pentru că exercită un rol funcțional dat. Astfel, drepturile fundamentale ale omului sunt atașate fiecărui individ în calitatea sa de ființă umană. La fel, drepturile politice se acordă indivizilor cărora legea le recunoaște rolul funcțional al cetățenilor. Un drept inalienabil este netransferibil : nu poate fi cumpărat sau vândut. Dacă ar fi transferabil, cumpărătorul nu ar putea să-l folosească dacă nu ar avea calitatea cerută și nu ar avea niciun motiv să o cumpere dacă ar avea deja această calitate cerută.

La fel, David Ellerman definește dreptul alienabil după cum urmează: este un drept care se atașează unui individ fără ca acesta să satisfacă nicio calitate. Un astfel de drept este transferabil  : poate fi dobândit din mâinile unui prim titular și eventual revândut ulterior. Cel mai clasic exemplu este dreptul la proprietate.

 Un drept inalienabil expiră automat la moartea titularului său din simplul motiv că și calitatea prin care a fost deținut acest drept expiră. Pe de altă parte, un drept înstrăinabil nu expiră la moartea titularului său: este transferat automat moștenitorilor săi.
 Dreptul la vot pe care o deține în calitate de cetățean, lucrător uniune sau cooperator este un inalienabil drept , în timp ce dreptul de vot deținut de acționar al unei societăți capitaliste este un alienabil drept .
 Un drept inalienabil nu este un drept care necesită consimțământul titularului său pentru a fi înstrăinat; este un drept care nu poate fi deloc înstrăinat, chiar dacă titularul acestui drept este de acord cu acesta . Rezultatul, potrivit lui Ellerman, este "o problemă majoră în teoria lui John Rawls și în ansamblul filosofiei liberale sau contractuale de astăzi" .


UPWARDLY YOURS PRODUCTIONS is the film production company of JONATHAN KELT. His goal is to be absolutely true to his creative vision, innovative in his scripts and productions, and to bring an experience of WOW to all that he offers the public.
JONATHAN founded this production company in June 2016 during the shoot of his first film, the short film HIDDEN TREASURE. He is eternally grateful to his talented cast and crew, and also his caterer and website designer, who all have been integral in bringing his ideas to manifestation.


Not necessary. All memes should be assumed to be reposts. Labelling it as such serves no purpose.
How so? People know going into the movie that the Kree are involved. It's like saying Thor is from Asgard. It's not a plot development that changes something about the character.
People who complain about reposts are NOT WELCOME on any meme site any time, for any reason.


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: >
    A TypeError exception is thrown if the this value is not an object for
    which the value of the internal [[Class]] property is "RegExp"
es5id: 15.10.6.3_A2_T2
description: The tested object is Math
---*/

__instance = Math;

__instance.test = RegExp.prototype.test;

//CHECK#1
try {
  with(__instance) test("message to investigate");
  $ERROR('#1.1: __instance = Math; __instance.test = RegExp.prototype.test;  with(__instance) test("message to investigate")');
} catch (e) {
  if ((e instanceof TypeError) !== true) {
    $ERROR('#1.2: __instance = Math; __instance.test = RegExp.prototype.test;  with(__instance) test("message to investigate"). Actual: ' + (e));
  }
}


text:
Q: React function inside a fetching I'm listing a table with lot of rows, and i would like to use a new function in each row dependly on the {transaction.to_address} value
I want to use useeffect() function inside a fetching function, but i've got this error message:
Rendered more hooks than during the previous render.
I have tried many solution i found here, i've spent almost a whole day, but i'm not smart enough to fix it.
export default function Transactions({user}){

    const Web3Api = useMoralisWeb3Api()
    const [transactions, setTransactions] = useState()
    const BASE_URL = "https://bscscan.com/tx/"

    const fetchTransactions = async () => {
        const data = await Web3Api.account.getTransactions({
            chain: "bsc",
            address: user.get('wallet2')
        })
        if(data) {
            setTransactions(data.result)
        }
    }

    useEffect(() => {
        fetchTransactions()
    }, [])

    return(
            <TableContainer>

                <TableCaption>TRANSACTIONS</TableCaption>

                    #
                    TYPE
                    GAS
                    VALUE
                    4
                    5
                    Value

                {transactions && transactions.map(transaction => (
                  transaction.value >= 1 ?

                        <Link href={`${BASE_URL}${transaction.hash}`} isExternal> {transaction.nonce}</Link>
                        TRANS{transaction.block_timestamp}
                        {transaction.receipt_gas_used * Moralis.Units.FromWei(transaction.gas_price)} BNB
                        {Moralis.Units.FromWei(transaction.value)} BNB
                       {transaction.block_timestamp}

                   {
                    useEffect(() => {
                        const url = "https://api.bscscan.com/api?module=contract&action=getsourcecode&address={transaction.to_address}&apikey=EEFI13SBM525DZ5ZNMBZHFEMVIT39DZA26";

                        const fetchData = async () => {
                            const response = await fetch(url)
                            const json = await response.json()

                        }
                        fetchData()
                    }, [])
                   }

                        <Link href={`${BASE_URL}${transaction.hash}`} isExternal> {transaction.hash}</Link>

                 : null))}

            </TableContainer>
    )
}

This is similar to my problem, but not working for me
Uncaught Invariant Violation: Rendered more hooks than during the previous render

A: First of all i don't think it's a good practice to use useEffect hook in the middle of html code, useEffect should be always called before return. Read more here. Secondly you should think if this approach is any good as fetching data in a for cycle might cause much load on your server (it depends how many transactions you have and how many requests you are sending every-time).
useEffect is used to fetch data when the page loads or you can place parameters to it so it runs the code again when the parameters change. You can fetch data without useEffect.
As i cannot replicate your code please try running this on your own.
export default function Transactions({ user }) {
  const Web3Api = useMoralisWeb3Api();
  const [transactions, setTransactions] = useState();
  const [transaction, setTransaction] = useState();
  const [finished, setFinished] = useState(false);
  const BASE_URL = "https://bscscan.com/tx/";

  const fetchTransactions = async () => {
    const data = await Web3Api.account.getTransactions({
      chain: "bsc",
      address: user.get("wallet2"),
    });
    if (data) {
      setTransactions(data.result);
      setFinished(true);
    }
  };

  useEffect(() => {
    if (finished && transactions) {
      let list = [];
      Promise.all(
        transactions.map(async (transaction) => {
          const API = `https://api.bscscan.com/api?module=contract&action=getsourcecode&address=${transaction.to_address}&apikey=EEFI13SBM525DZ5ZNMBZHFEMVIT39DZA26`;
          const data = await fetch(API);
          if (data) {
            list.push(data);
          }
        })
      );
      setTransaction(list);
      setFinished(true);
    }
  }, [finished]);

  return (
    <TableContainer>

        <TableCaption>TRANSACTIONS</TableCaption>

            #
            TYPE
            GAS
            VALUE
            4
            5
            Value

          {transactions &&
            transactions.map((transaction, index) =>
              transaction.value >= 1 ? (

                    <Link href={`${BASE_URL}${transaction.hash}`} isExternal>
                      {" "}
                      {transaction.nonce}
                    </Link>

                  TRANS{transaction.block_timestamp}

                    {transaction.receipt_gas_used *
                      Moralis.Units.FromWei(transaction.gas_price)}{" "}
                    BNB

                  {Moralis.Units.FromWei(transaction.value)} BNB
                  {transaction.block_timestamp}
                  {transaction[index].ContractName}

                    <Link href={`${BASE_URL}${transaction.hash}`} isExternal>
                      {" "}
                      {transaction.hash}
                    </Link>

              ) : null
            )}

    </TableContainer>
  );
}

A: I tried without testing it, so let me know :
export default function Transactions({user}){

    const Web3Api = useMoralisWeb3Api()
    const [transactions, setTransactions] = useState(null)
    const [transactionsAddress,setTransactionsAddress]= useState(null)
    const BASE_URL = "https://bscscan.com/tx/"

    const fetchTransactions = async () => {
        const data = await Web3Api.account.getTransactions({
            chain: "bsc",
            address: user.get('wallet2')
        })
        if(data) {
            setTransactions(data.result)
        }
    }
    const fetchData = useCallBack(async (myUrl) => {
        const response = await fetch(myUrl)
        const json = await response.json()
        return json},
        []);

    useEffect(() => {
        fetchTransactions()
    }, [])

    useEffect(() => {
        transactions ?? (async ()=>{
        let url=""
        const fetchTransationsAddress= await Promise.all(transactions.map(async (transaction) => {
            url = `https://api.bscscan.com/api?module=contract&action=getsourcecode&address=${transaction.to_address}&apikey=EEFI13SBM525DZ5ZNMBZHFEMVIT39DZA26`;
            return await fetchData(url);

        }));
        setTransactionsAddress(fetchTransationsAddress);
    })
    }, [transactions])

    return(
            <TableContainer>

                <TableCaption>TRANSACTIONS</TableCaption>

                    #
                    TYPE
                    GAS
                    VALUE
                    4
                    5
                    Value

                {transactions && transactions.map((transaction,index) => (
                  transaction.value >= 1 ?

                        <Link href={`${BASE_URL}${transaction.hash}`} isExternal> {transaction.nonce}</Link>
                        TRANS{transaction.block_timestamp}
                        {transaction.receipt_gas_used * Moralis.Units.FromWei(transaction.gas_price)} BNB
                        {Moralis.Units.FromWei(transaction.value)} BNB
                       {transaction.block_timestamp}

                        {
                        //map here in your address, for example
                        transactionsAddress[index] && transactionsAddress[index].map((address) =>{return({address}	)})}

                        <Link href={`${BASE_URL}${transaction.hash}`} isExternal> {transaction.hash}</Link>

                 : null))}

            </TableContainer>
    )
}

For your tests, simplify your code  like this:
       export default function Transactions({user}){

            const Web3Api = useMoralisWeb3Api()
            const [transactions, setTransactions] = useState(null)
            const [transactionsAddress,setTransactionsAddress]= useState(null)
            const BASE_URL = "https://bscscan.com/tx/"

            const fetchTransactions = async () => {
                console.log('fetchTransactions');
                const data = await Web3Api.account.getTransactions({
                    chain: "bsc",
                    address: user.get('wallet2')
                })
                if(data) {
                    setTransactions(data.result)
                }
            }
            const fetchData = useCallBack(async (myUrl) => {
                console.log('callback fetchdata')
                const response = await fetch(myUrl)
                const json = await response.json()
                return json},
                []);

            useEffect(() => {
                console.log('useEffect 1');
                fetchTransactions()
            }, [])

            useEffect(() => {
                console.log('useEffect 2');
                if (transactions!==null){
                  (async ()=>{
                   let url="";
                   console.log('async function inside useEffect2')
                   const fetchTransationsAddress= await Promise.all(transactions.map(async (transaction) => {
                    url = `https://api.bscscan.com/api?module=contract&action=getsourcecode&address=${transaction.to_address}&apikey=EEFI13SBM525DZ5ZNMBZHFEMVIT39DZA26`;
                    return await fetchData(url);

                }));
                setTransactionsAddress(fetchTransationsAddress);
  })();
  }}, [transactions,fetchData])

        console.log(transactions)
        console.log(transactionsAddress)

            return(
Go to your console

    )}

And know try to find what's wrong, you can add some console.log("what you want") to understand. You also need to check if your API calls are returning data (depending on your subscription your are possibly limited)