  Entanglement entropy quantifies the amount of uncertainty of a quantum state.
For quantum fields in curved space, entanglement entropy of the quantum field
theory degrees of freedom is well-defined for a fixed background geometry. In
this paper, we propose a generalization of the quantum field theory
entanglement entropy by including dynamical gravity. The generalized quantity
named effective entropy, and its Renyi entropy generalizations, are defined by
analytic continuation of a gravitational path integral on replica geometry with
a co-dimension-$2$ brane at the boundary of region we are studying. We discuss
different approaches to define the region in a gauge invariant way, and show
that the effective entropy satisfies the quantum extremal surface formula. When
the quantum fields carry a significant amount of entanglement, the quantum
extremal surface can have a topology transition, after which an entanglement
island region appears. Our result generalizes the Hubeny-Rangamani-Takayanagi
formula of holographic entropy (with quantum corrections) to general geometries
without asymptotic AdS boundary, and provides a more solid framework for
addressing problems such as the Page curve of evaporating black holes in
asymptotic flat spacetime. We apply the formula to two example systems, a
closed two-dimensional universe and a four-dimensional maximally extended
Schwarzchild black hole. We discuss the analog of the effective entropy in
random tensor network models, which provides more concrete understanding of
quantum information properties in general dynamical geometries. By introducing
ancilla systems, we show how quantum information in the entanglement island can
be reconstructed in a state-dependent and observer-dependent map. We study the
closed universe (without spatial boundary) case and discuss how it is related
to open universe.
