We propose a numerical algorithm for finding optimal measurements for quantum-state discrimination. The theory of the semidefinite programming provides a simple check of the optimality of the numerically obtained results. With the help of our algorithm we calculate the minimum attainable error rate of a device discriminating among three particularly chosen non-symmetric qubit states.Nonorthogonality of quantum states is one of the basic features of quantum mechanics. Its deep consequences are reflected in all quantum protocols. For instance, it is well known that perfect decisions between two nonorthogonal states cannot be made. This has important implications for the information processing at the microscopic level since it sets a limit on the amount of information that can be encoded into a quantum system. Although perfect decisions between nonorthogonal quantum states are impossible, it is of importance to study measurement schemes performing this task in the optimum, though imperfect, way.Two conceptually different models of decision tasks have been studied. The first one is based on the minimization of the Bayesian cost function, which is nothing but a generalized error rate [1]. In the special case of linearly independent pure states, the second modelunambiguous discrimination of quantum states -makes an interesting alternative. The latter scheme combines the error-less discrimination with a certain fraction of inconclusive results [2][3][4].Ambiguous as well as unambiguous discrimination schemes have been intensively studied over the past few years. In consequence, the optimal measurements distinguishing between pair, trine, tetrad states, and linearly independent symmetric states are now well understood [5,7,6,[8][9][10][11][12][13][14][15][16][17]. Many of the theoretically discovered optimal devices have already been realized experimentally, mainly with polarized light [18][19][20][21]. As an example of the practical importance of the optimal decision schemes let us mention their use for the eavesdropping on quantum cryptosystems [22,23].The purpose of this paper is to develop universal method for optimizing ambiguous discrimination between generic quantum states.Assume that Alice sets up M different sources of quantum systems living in p-dimensional Hilbert space. The complete quantum-mechanical description of each source * e-mail: rehacek@phoenix.inf.upol.cz is provided by its density matrix. Alice chooses one of the sources at random using a chance device and sends the generated quantum system to Bob. Bob is also given M numbers {ξ i } specifying probabilities that i-th source is selected by the chance device. Bob is then required to tell which of the M sources {ρ i } generated the quantum system he had obtained from Alice. In doing this he should make as few mistakes as possible.It is well known [1] that each Bob's strategy can be described in terms of an M -component probability operator measure (POM) {Π j }, 0 < Π i < 1, j Π j = 1. Each POM element corresponds to one output channel of Bob's discri...