In the following filtration, I get 6 persistent cohomology intervals ("barcodes"):
$[0,1) $
$[0,2)$
$[0,\infty) $
$[1,\infty)$
$[2,\infty)$
$[3,\infty)$
However, according to "duality" with persistent homology, there should only be 4 barcodes:
$[0,1)$
$[0,2)$
$[0,\infty)$
$[3,\infty)$
However, I can't figure out where I went wrong in the persistent cohomology calculation.
I thought that the cochain $[v_1,v_2]^*$, which takes value 1 on the edge $[v_1,v_2]$ and 0 otherwise, is a cocycle, that is never killed since there are no 2 simplices in the entire filtration. Hence, it should have a barcode $[1,\infty)$?
Similarly, the cochain $[v_2,v_3]^*$ should give rise to a barcode $[2,\infty)$?
Thanks for any help.

I guess that an interval $[1,\infty)$ means that some cohomology class exists for $H^*(K_3)$ and its image under $H^*(K_3)\to H^*(K_1)$ is still nonzero. You can take a $1$-cocycle that assigns three nonzero numbers to the three edges.
Similarly, the interval $[2,\infty)$ corresponds to a $1$-cocycle that assigns a nonzero numbers to $v_2 v_3$ but zero to $v_1 v_2$ and $[3,\infty)$ to a cocycle that assigns a nonzero number to $v_1 v_3$ and zero to the remaining edges.