Let $F(d\_1,d\_2,\ldots,d\_k;n )$ be the variety of all flags $\mathbb A^{d\_1} \subset\mathbb A^{d\_2}\subset\ldots\subset \mathbb A^{d\_k}\subset \mathbb A^{n}$. This variety has the natural maps to Grassmann varieties:
$$
f\_i:F(d\_1,d\_2,\ldots,d\_k; n) \to F(d\_i;n),
$$
and pull-backs $f\_i^\*\mathcal O(1)$ from Grassmannians give a basis of $\mathrm{Pic}(F(d\_1,\ldots,d\_k;n))$. Or, combinatorially, the pullbacks of the unique Shubert divisors on Grassmannians are Shubert divisors on $F(d\_1,\ldots,d\_k;n)$ and they generate the Picard group. 



> 
> How can one calculate the canonical class of $F(d\_1,\ldots, d\_k; n)$ in these terms? 
> 
> 
> 


Or, one can ask more general question.


Let $G/P$ be a projective homogeneous space. Here $P\subset G$ is parabolic and $G/P$ can be described by a system of roots (for $G$) and its subsystem (for $P$). How can one calculate the canonical class of $G/P$ in this terms? 



Canonical class of partial flag variety
If $G$ is simply connected (so, $SL\_n$ in your less general question), then every line bundle $\mathcal L$ is uniquely of the form $G \times^B \mathbb C\_\lambda$ where $\mathbb C\_\lambda$ is the $T$-irrep with weight $\lambda$. From there, you can figure out $\lambda$ from $\mathcal L$ by looking at the $T$-weight over the basepoint.


The tangent space at the basepoint is $\mathfrak g/\mathfrak p$, and the $T$-weights are thus $\Delta^G\_- \setminus \Delta^L\_-$, where $L$ is the Levi subgroup of $P$. The $T$-weight on the fiber of the canonical bundle is thus the sum of $\Delta^G\_+ \setminus \Delta^L\_+$. 


In the $G=SL\_n$ case (I haven't worked out other cases), the coefficient in the *anti*canonical class of the $i$th Schubert divisor (here $i$ is a simple root not in $L$) is $$1+\max \{ |[j,k] \subseteq [1,n-1]| : \text{ the only simple root in $[j,k]$ in $L$ is }i\}.$$ For example, in $SL\_n/B$ this interval is $[i,i]$ for each $i$ and so each appears with coefficient $2$. (Which fits with $\sum \Delta^G\_+ = 2\rho = 2\sum\_{i=1}^{n-1} [X\_{r\_i}]$.) On $Gr(k,n)$ this interval is $[1,n-1]$ for $i=k$ and so the anticanonical class is $\mathcal O(n)$. 


