Let L be a line bundle on a smooth affine variety X (say, over complex numbers). Is it true that L always admits a FLAT algebraic connection?
[Math] line bundles on smooth affine variety
ag.algebraic-geometry
Related Solutions
As was noted in the comment, $d$ must be $0$ (bundles with a flat connection can have only degree $0$), and different connections can lead to the same bundle. However, every line bundle of degree zero on an elliptic (or higher genus) curve has a unique flat unitary connection, i.e. in your example with $|\lambda|=|\mu|=1$. This identifies the Jacobian of any smooth projective complex curve with a product of $2g$ circles (once you fix a basis of $H_1(C,\Bbb Z)$). For an elliptic curve, this is the usual identification with the 2-torus.
I presume that your variety $X$ is smooth.
Consider the additive map $\mathrm d\log \colon \mathscr O_X^*\to \Omega^1_X$ that sends $f$ to $\mathrm df/f$. It induces a map $c_1$ in cohomology from $H^1(X,\mathscr O_X^*)$ to $H^1(X,\Omega^1_X)$ — a coherent avatar of the first Chern class. By Hodge Theory, $H^1(X,\Omega^1_X)$ is a subspace of $H^2(X,\mathbf C)$ and the two notions of first Chern class coincide.
A line bundle $\mathscr L$ has a connection if and only if its first Chern class $c_1(\mathscr L)\in H^1(X,\Omega^1_X)$ vanishes. The proof is straightforward: take an open cover $(U_i)$ of $X$, an invertible section $s_i$ of $\mathscr L$ on $U_i$ and the associated cocycle $(f_{ij})$ representing your line bundle in $H^1(X,\mathscr O_X^*)$. A connection $\nabla$ maps $s_i$ to $s_i\otimes\omega_i$, for some 1-form $\omega_i\in H^0(U_i,\Omega^1_X)$. The condition that these $s_i\otimes\omega_i$ come from a global connection on $X$ is exactly the vanishing of $c_1(\mathscr L)$.
It is a non-trivial fact that if $\mathscr L$ has an algebraic connection, then it is automatically flat. Torsten Ekedahl gave an algebraic proof on this thread of MO (Ekedahl also observes that $p$th power of line bundles in characteristic $p$ have an integrable connection), but an analytic proof seems easy. The algebraic connexion $\nabla$ gives rise to a connexion $\nabla+\bar\partial$ on the associated holomorphic line bundle. One checks that the curvature of this connection is a $(2,0)$-form, while it should be a $(1,1)$-form. Consequently, it vanishes.
When non empty, the set of flat connections on a vector bundle $\mathscr E$ is an affine space under $H^0(X,\Omega^1_X\otimes\mathscr E\mathit{nd}(\mathscr E))$, a finite dimensional vector space. In our case, $\mathscr L$ is a line bundle, hence $\mathscr E\mathit{nd}(\mathscr L)$ is the trivial line bundle so that we get $H^0(X,\Omega^1_X)$.
NB. Following the comment of Ben McKay, I edited the last paragraph.
Best Answer
No, any line bundle with a flat connection has a trivial rational Chern class. Now, take any smooth connected projective variety $X$ for which the Chern classes of line bundles form a group of rank $r$ larger than $1$. Removing an irreducible ample divisor $D$ from $X$ gives a smooth affine variety for which the Chern classes form a group of rank $r-1$. A specific example is $\mathbb P^1\times\mathbb P^1$ but there are lots of others of any dimension $>1$.