algebraic versus analytic line bundles

Here is an example of non-surjectivity. Let $X = \mathbb{A}^2 \setminus 0$. I claim that $Pic(X)$ is $0$, but $Pic(X^{an}) \neq 0$.

Proof that $Pic(X)= 0$: There is an affine cover $X = U_1 \cup U_2$ where $U_1 = \{ (x, y) : x \neq 0 \}$ and $U_2 = \{ (x,y) : y \neq 0 \}$. Note that $U_1$, $U_2$ and $U_{12}$ are all Spec's of UFD's, so their Picard groups are trivial and we can compute $Pic(X)$ in terms of this open cover. The corresponding unit groups are $\{ \alpha x^i : \alpha \in \mathbb{C}^*, \ i \in \mathbb{Z} \}$, $\{ \alpha y^j : \alpha \in \mathbb{C}^*, \ j \in \mathbb{Z} \}$ and $\{\alpha x^i y^j : \alpha \in \mathbb{C}^*, \ (i,j) \in \mathbb{Z}^2 \}$. So the Cech complex is $$\left( \mathbb{C}^* \oplus \mathbb{Z}\right) \oplus \left( \mathbb{C}^* \oplus \mathbb{Z}\right) \to \mathbb{C}^* \oplus \mathbb{Z}^2,$$ which clearly has no cokernel.

Proof that $Pic(X^{an}) \neq 0$: We could mimic the above, but it is a little simpler to first use the exponential sequence $0 \to \mathbb{Z} \to \mathcal{O} \to \mathcal{O}^* \to 0$. Since $X \cong \mathbb{R}^4 \setminus \{ (0,0) \}$ retracts on $S^3$, we have $H^1(X, \mathbb{Z}) \cong H^2(X, \mathbb{Z}) \cong 0$ and $H^1(X, \mathcal{O}) \cong H^1(X, \mathcal{O}^*)$. Computing $H^1(X, \mathcal{O})$ from the Cech cover above, we get that it is spanned by the set of all sums $\{ \sum a_{ij} x^{-i} y^{-j} \}$ where the sum is convergent everywhere in $U_{12}$.

So the simplest example of a nontrivial class in $H^1(X, \mathcal{O})$ is the Cech cocycle $U_{12} \mapsto x^{-1} y^{-1}$, and the simplest nontrivial line bundle is to take trivial line bundles on $U_1$ and $U_2$ and glue them together by $e^{x^{-1} y^{-1}}$.


Here is another example of non-surjectivity: Let $E$ be a smooth hyperplane section of a smooth cubic surface $X$, and let $U$=$X-E$. Then $\text{rk Pic}_{\text{alg}}(U) \leq \text{rk Pic}_{\text{alg}}(X) = 7$.

On the other hand, $U$ is Stein, implying that $\text{Pic}_{\text{an}}(U) \cong H^2(U,\mathbb{Z})$. Since $$9 = \chi_{\text{top}}(X) = \chi_{\text{top}}(X) - \chi_{\text{top}}(E)=\chi_{\text{top}}(U) = 1-h^1(U)+h^2(U)$$ we must have $h^2(U) \geq 8$.