# Criterion for triviality of a line bundle on a projective scheme

Let $X$ be a projective scheme over $\mathbb{C}$ with a very ample line bundle $\mathcal{O}(1)$. Let $L$ be a line bundle on $X$ and suppose that $\dim_{\mathbb{C}} H^i(L(d)) = \dim_{\mathbb{C}} H^i(\mathcal{O}_X(d))$ for all integers $i \geq 0$ and $d \in \mathbb{Z}$. Does this imply that $L \cong \mathcal{O}_X$?

Yes (for integral $X$). Moreover, it is enough to have this equality for $i = 0$ only.
First, when $d = 0$ and $i = 0$ we have $H^0(O_X) = k$, hence $H^0(L) = k$. It gives an exact sequence $$0 \to O_X \to L \to F \to 0,$$ where $F$ is a coherent sheaf on $X$. Now twist the sequence by $O_X(d)$ with $d \gg 0$. Then $H^1(O_X(d)) = 0$, hence exact sequence of cohomology gives $$0 \to H^0(O_X(d)) \to H^0(L(d)) \to H^0(F(d)) \to 0.$$ The first two terms have the same dimension, hence $H^0(F(d)) = 0$. Since this is true for all $d \gg 0$, it follows that $F = 0$, hence $L \cong O_X$.
EDIT. In the nonintegral case this is wrong. As an example, let $X$ be a reducible conic (a union of two lines intersecting at a point). Let $L$ be the line bundle that restricts as $O(1)$ to one of the lines and as $O(-1)$ to the other. Then an easy verification shows that $H^i(O_X(d)) = H^i(L(d))$ for all $i$ and $d$, still $L$ is not isomorphic to $O_X$.