linear potential now uses special way of calculating factorie dot products taken from the Factor implementation