The E and B Experiment (EBEX) was a long-duration balloon-borne cosmic microwave background polarimeter that flew over Antarctica in 2013. We describe the experiments optical system, receiver, and polarimetric approach, and report on their in-flight performance. EBEX had three frequency bands centered on 150, 250, and 410 GHz. To make efficient use of limited mass and space we designed a 115 cm$^{2}$sr high throughput optical system that had two ambient temperature mirrors and four anti-reflection coated polyethylene lenses per focal plane. All frequency bands shared the same optical train. Polarimetry was achieved with a continuously rotating achromatic half-wave plate (AHWP) that was levitated with a superconducting magnetic bearing (SMB). Rotation stability was 0.45 % over a period of 10 hours, and angular position accuracy was 0.01 degrees. This is the first use of a SMB in astrophysics. The measured modulation efficiency was above 90 % for all bands. To our knowledge the 109 % fractional bandwidth of the AHWP was the broadest implemented to date. The receiver that contained one lens and the AHWP at a temperature of 4 K, the polarizing grid and other lenses at 1 K, and the two focal planes at 0.25 K performed according to specifications giving focal plane temperature stability with fluctuation power spectrum that had $1/f$ knee at 2 mHz. EBEX was the first balloon-borne instrument to implement technologies characteristic of modern CMB polarimeters including high throughput optical systems, and large arrays of transition edge sensor bolometric detectors with mutiplexed readouts.