We study analytically and numerically the behavior of the concurrence (a measure of the entanglement of formation) of a pair of qubits in a quantum computer operating an efficient algorithm for quantum chaos. Our results show that in an ideal algorithm the entanglement decays exponentially with the diffusive relaxation rate induced by classical chaos. This decay reaches a residual level which drops exponentially with the number of qubits nq. Decoherence destroys the residual entanglement with a rate exponential in nq.PACS numbers: 03.67. Lx, 05.45.Mt Enormous interest into quantum information and computation [1] has generated serious efforts in characterizing and understanding quantum entanglement which is considered as the ultimate origin of quantum power (see a recent review [2]). A quantitative measure of the entanglement of formation, namely the concurrence C, was introduced and shown to be able to characterize an arbitrary state of two qubits [3,4]. Being closely related to the von Neumann entropy S of the reduced density matrix ρ of two qubits[31], this quantity was recently found to have interesting applications to quantum phase transitions in interacting spin systems [5]. In parallel, the properties of entanglement were investigated in a quantum model of coupled tops where it was shown that there exists a typical value of entanglement which is determined by the chaotic behavior of the dynamics of the model [6] and that the growth rate of entanglement of initially decoupled tops is increased by the underlying classical chaos [7]. On the same line, it was recently shown that contrary to intuition even a heat bath may create entanglement between two qubits [8].All these studies [5,6,7,8] clearly demonstrated how rich entanglement properties can be in interacting quantum systems. However, in the context of quantum computation it is much more crucial to analyze the evolution of entanglement in a specific algorithm performing an operational task. Indeed, it is expected that the entanglement is very sensitive to noise and decoherence [9,10,11] and the understanding of its behavior in an operating algorithm can lead to better strategies in the control of decoherence and imperfection effects. As for our knowledge such direct investigations have not been performed until now. Therefore, in this paper we study the behavior of the concurrence in an efficient algorithm for the quantum sawtooth map which has been proposed recently in [12]. The algorithm for this model has a number of important advantages: all n q qubits are used in an optimal way and no ancillae are required, one map iteration in * URL: http://www.quantware.ups-tlse.fr the Hilbert space of size N = 2 nq is performed in O(n 2 q ) quantum gates, and the algorithm is based on the quantum Fourier transform (QFT) which is one of the main elements of various quantum algorithms [1]. This allows to simulate a complex dynamics in the regime of quantum chaos with a small number of qubits. Since the entanglement can be efficiently measured experimentally (see e...