An X-ray polarimeter for hard X-ray optics