How to compute the Picard rank of a K3 surface? I'm curious about the following question:

Given a K3 surface, how does one proceed to compute its rank?

Of course the answer may depend on the form of the input, i.e. how the K3 is "given". So

For a given way of writing down a K3 surface, (e.g. quartics in $\mathbb{P}^3$) 
   How does one compute the Picard rank of the K3 surface?

(Aside: What I've seen people sometimes did is avoiding this question by nailing down a K3 surface $X$ with its $NS(X)$ together with the intersection form. Then find an embedding given by the ample class.)
 A: In Theorem 6 of the following paper : http://arxiv.org/abs/1111.4117, building on Van Lujik's work, François Charles explains a (theoretical) algorithm that computes the rank of a K3 surface $X$ defined over a number field. This algorithm terminates conjecturally, for instance if $X\times X$ satisfies the Hodge conjecture. 
The main new feature of this article, that allows him to obtain an algorithm, is that the discrepancy between the rank of $X$ and the rank of the reduction of $X$ at a typical prime may be read off the algebra of endomorphisms of the transcendental lattice of $X$.
A: There are some papers of van Luijk, where he computes the ranks of some K3s over number fields.  The trick is to note that $NS(X) \hookrightarrow NS(X_p)$, where $X_p$ is the reduction of $X$ modulo a prime ideal $p$.  One can determine the rank of $NS(X_p)$ by counting eigenvalues of Frobenius which differ from $q$ (the size of the residue field) by a root of unity.  If you want to find rank 1 K3s, you can reduce modulo two different primes and hope to find rank 2 reductions which have lattices which are incompatible in some sense, forcing $NS(X)$ to be rank 1.  (The issue here is that the rank of $NS(X_p)$ will always be even, so you can't win by using a single prime.)
I'm not sure how this works when you want to find K3s of larger rank though, unless you had a way of exhibiting linearly independent divisor classes.  Anyhow, van Luijk uses this technique to find rank 1 quartics in $\mathbb{P}^3$ and I think others have done the same with genus 2 K3s defined over $\mathbb{Q}$.        
I should add that the situation is much easier for Kummer surfaces.  If I'm not mistaken, the rank of $X = K(A)$ ($A$ is an abelian surface) is 16 plus the Picard rank of $A$.  The 16 comes from the 16 exceptional divisors you get when you blow up $A$ at its 2-torsion points.  The rank of $A$ is usually not hard to figure out: a generic $A$ has rank 1, if $A$ is a product of elliptic curves then its rank is 2,3 or 4 depending on whether the curves are isogenous and whether they have CM or not, and there are a few other cases which one can probably figure out...      
