TITLE: When is a nilpotent Lie algebra isomorphic to the associated graded of its lower central series?
QUESTION [7 upvotes]: All Lie algebras in this question are finite-dimensional and defined over a field $k$ of characteristic $0$ which I'm happy to take to be $\mathbb{R}$ or $\mathbb{C}$.
$\DeclareMathOperator\gr{gr}$Let $L$ be a nilpotent Lie algebra.  It is then filtered by its lower central series, and we have an associated graded nilpotent Lie algebra $\gr L$.  It is definitely not the case that $L$ and $\gr L$ have to be isomorphic; see Malcev Lie algebra and associated graded Lie algebra for some examples.
Question: what kinds of conditions can I put on $L$ that ensure that it is isomorphic to $\gr L$?  E.g. if the field is $\mathbb{R}$ are the there geometric/topological/algebraic conditions on the associated simply-connected nilpotent Lie group that ensure this?

REPLY [2 votes]: $\DeclareMathOperator\gr{gr}$Too tired to think clearly, but it looks like a standard Deformation Theory thingy.
We have natural linear maps $\gamma_n (L)\rightarrow \gr_n L$. Split them as linear maps. We get a bijective linear map $L\rightarrow \gr L$.
Use it to equip $\gr L$ with a second Lie algebra structure $[,]^{\prime}$, coming from $L$. Now consider the difference
$$\mu:L\otimes L \rightarrow L, \ \ \mu (x\otimes y) = [x,y]-[x,y]^{\prime}.$$
I claim that $\mu$ is a 2-cocycle on $\gr L$ and that finding an isomorphism $\gamma_n (L)\cong \gr_n L$ is equivalent to finding a 1-cochain $\theta$ such that $\mu=d\theta$.