Spin factors and geometric phases in arbitrary dimensions