In recent work, Hickerson and the author demonstrated that it is useful to
think of Appell--Lerch sums as partial theta functions. This notion can be used
to relate identities involving partial theta functions with identities
involving Appell--Lerch sums. In this sense, Appell--Lerch sums and partial
theta functions appear to be dual to each other. This duality theory is not
unlike that found by Andrews between various sets of identities of
Rogers-Ramanujan type with respect to Baxter's solution to the hard hexagon
model of statistical mechanics. As an application we construct bilateral
q-series with mixed mock modular behaviour.Comment: To be published in Advances in Mathematic