We prove the following surprising result: given any quantum state ρ on n qubits, there exists a local Hamiltonian H on poly (n) qubits (e.g., a sum of two-qubit interactions), such that any ground state of H can be used to simulate ρ on all quantum circuits of fixed polynomial size. In terms of complexity classes, this implies that BQP/qpoly ⊆ QMA/poly, which supersedes the previous result of Aaronson that BQP/qpoly ⊆ PP/poly. Indeed, we can exactly characterize quantum advice, as equivalent in power to untrusted quantum advice combined with trusted classical advice.Proving our main result requires combining a large number of previous tools-including a result of Alon et al. on learning of real-valued concept classes, a result of Aaronson on the learnability of quantum states, and a result of Aharonov and Regev on 'QMA + super-verifiers'-and also creating some new ones. The main new tool is a so-called majority-certificates lemma, which is closely related to boosting in machine learning, and which seems likely to find independent applications. In its simplest version, this lemma says the following. Given any set S of Boolean functions on n variables, any function f ∈ S can be expressed as the pointwise majority of m = O (n) functions f 1 , . . . , f m ∈ S, such that each f i is the unique function in S compatible with O (log |S|) input/output constraints.