Ion-trap cavity QED system for probabilistic entanglement