  Tsallis' non-extensive entropy is extended to incorporate the dependence on
affinities between the microstates of a system. At the core of our construction
of the extended entropy ($\mathcal{H}$) is the concept of the effective number
of dissimilar states, termed the effective diversity ($\mathit{\Delta}$). It is
a unique integrated measure derived from the probability distribution among
states and the affinities between states. The effective diversity is related to
the extended entropy through the Boltzmann's-equation-like relation,
$\mathcal{H}=\ln_{q}\mathit{\Delta}$, in terms of the Tsallis' $q$-logarithm. A
new principle called the Nesting Principle is established, stating that the
effective diversity remains invariant under an arbitrary grouping of the
constituent states. It is shown that this invariance property holds only for
$q=2$; however, the invariance is recovered for general $q$ in the
zero-affinity limit (i.e. the Tsallis and Boltzmann-Gibbs case). Using the
affinity-based extended Tsallis entropy, the microcanonical and the canonical
ensembles are constructed in the presence of general between-state affinities.
It is shown that the classic postulate of equal a priori probabilities no
longer holds but is modified by affinity-dependent terms. As an illustration, a
two-level system is investigated by the extended canonical method, which
manifests that the thermal behaviours of the thermodynamic quantities at
equilibrium are affected by the between-state affinity. Furthermore, some
applications and implications of the affinity-based extended diversity/entropy
for information theory and biodiversity theory are addressed in appendices.
