288,345 research outputs found

    Duel and sweep algorithm for order-preserving pattern matching

    Full text link
    Given a text TT and a pattern PP over alphabet Σ\Sigma, the classic exact matching problem searches for all occurrences of pattern PP in text TT. Unlike exact matching problem, order-preserving pattern matching (OPPM) considers the relative order of elements, rather than their real values. In this paper, we propose an efficient algorithm for OPPM problem using the "duel-and-sweep" paradigm. Our algorithm runs in O(n+mlogm)O(n + m\log m) time in general and O(n+m)O(n + m) time under an assumption that the characters in a string can be sorted in linear time with respect to the string size. We also perform experiments and show that our algorithm is faster that KMP-based algorithm. Last, we introduce the two-dimensional order preserved pattern matching and give a duel and sweep algorithm that runs in O(n2)O(n^2) time for duel stage and O(n2m)O(n^2 m) time for sweeping time with O(m3)O(m^3) preprocessing time.Comment: 13 pages, 5 figure

    Quantum process tomography via completely positive and trace-preserving projection

    Get PDF
    We present an algorithm for projecting superoperators onto the set of completely positive, trace-preserving maps. When combined with gradient descent of a cost function, the procedure results in an algorithm for quantum process tomography: finding the quantum process that best fits a set of sufficient observations. We compare the performance of our algorithm to the diluted iterative algorithm as well as second-order solvers interfaced with the popular CVX package for MATLAB, and find it to be significantly faster and more accurate while guaranteeing a physical estimate.Comment: 13pp, 8 fig

    Variational Integrators for the Gravitational N-Body Problem

    Get PDF
    This paper describes a fourth-order integration algorithm for the gravitational N-body problem based on discrete Lagrangian mechanics. When used with shared timesteps, the algorithm is momentum conserving and symplectic. We generalize the algorithm to handle individual time steps; this introduces fifth-order errors in angular momentum conservation and symplecticity. We show that using adaptive block power of two timesteps does not increase the error in symplecticity. In contrast to other high-order, symplectic, individual timestep, momentum-preserving algorithms, the algorithm takes only forward timesteps. We compare a code integrating an N-body system using the algorithm with a direct-summation force calculation to standard stellar cluster simulation codes. We find that our algorithm has about 1.5 orders of magnitude better symplecticity and momentum conservation errors than standard algorithms for equivalent numbers of force evaluations and equivalent energy conservation errors.Comment: 31 pages, 8 figures. v2: Revised individual-timestepping description, expanded comparison with other methods, corrected error in predictor equation. ApJ, in pres

    Streaming Binary Sketching based on Subspace Tracking and Diagonal Uniformization

    Full text link
    In this paper, we address the problem of learning compact similarity-preserving embeddings for massive high-dimensional streams of data in order to perform efficient similarity search. We present a new online method for computing binary compressed representations -sketches- of high-dimensional real feature vectors. Given an expected code length cc and high-dimensional input data points, our algorithm provides a cc-bits binary code for preserving the distance between the points from the original high-dimensional space. Our algorithm does not require neither the storage of the whole dataset nor a chunk, thus it is fully adaptable to the streaming setting. It also provides low time complexity and convergence guarantees. We demonstrate the quality of our binary sketches through experiments on real data for the nearest neighbors search task in the online setting

    Numerical analysis of conservative unstructured discretisations for low Mach flows

    Get PDF
    This article may be used for non-commercial purposes in accordance with Wiley Terms and Conditions for Self-Archiving. https://authorservices.wiley.com/author-resources/Journal-Authors/licensing-and-open-access/open-access/self-archiving.htmlUnstructured meshes allow easily representing complex geometries and to refine in regions of interest without adding control volumes in unnecessary regions. However, numerical schemes used on unstructured grids have to be properly defined in order to minimise numerical errors. An assessment of a low-Mach algorithm for laminar and turbulent flows on unstructured meshes using collocated and staggered formulations is presented. For staggered formulations using cell centred velocity reconstructions the standard first-order method is shown to be inaccurate in low Mach flows on unstructured grids. A recently proposed least squares procedure for incompressible flows is extended to the low Mach regime and shown to significantly improve the behaviour of the algorithm. Regarding collocated discretisations, the odd-even pressure decoupling is handled through a kinetic energy conserving flux interpolation scheme. This approach is shown to efficiently handle variable-density flows. Besides, different face interpolations schemes for unstructured meshes are analysed. A kinetic energy preserving scheme is applied to the momentum equations, namely the Symmetry-Preserving (SP) scheme. Furthermore, a new approach to define the far-neighbouring nodes of the QUICK scheme is presented and analysed. The method is suitable for both structured and unstructured grids, either uniform or not. The proposed algorithm and the spatial schemes are assessed against a function reconstruction, a differentially heated cavity and a turbulent self-igniting diffusion flame. It is shown that the proposed algorithm accurately represents unsteady variable-density flows. Furthermore, the QUICK schemes shows close to second order behaviour on unstructured meshes and the SP is reliably used in all computations.Peer ReviewedPostprint (author's final draft
    corecore