Let
(
X
,
d
,
μ
)
(X,d, \mu )
be an Ahlfors
n
n
-regular metric measure space. Let
L
\mathcal {L}
be a non-negative self-adjoint operator on
L
2
(
X
)
L^2(X)
with heat kernel satisfying Gaussian estimate. Assume that the kernels of the spectral multiplier operators
F
(
L
)
F(\mathcal {L})
satisfy an appropriate weighted
L
2
L^2
estimate. By the spectral theory, we can define the imaginary power operator
L
i
s
,
s
∈
R
\mathcal {L}^{is}, s\in \mathbb R
, which is bounded on
L
2
(
X
)
L^2(X)
. The main aim of this paper is to prove that for any
p
∈
(
0
,
∞
)
p \in (0,\infty )
,
‖
L
i
s
f
‖
H
L
p
(
X
)
≤
C
(
1
+
|
s
|
)
n
|
1
/
p
−
1
/
2
|
‖
f
‖
H
L
p
(
X
)
,
s
∈
R
,
\begin{equation*} \big \|\mathcal {L}^{is} f\big \|_{H^p_{\mathcal {L}}(X)} \leq C (1+|s|)^{n|1/p-1/2|} \|f\|_{H^p_{\mathcal {L}}(X)}, \quad s \in \mathbb {R}, \end{equation*}
where
H
L
p
(
X
)
H^p_\mathcal {L}(X)
is the Hardy space associated to
L
\mathcal {L}
, and
C
C
is a constant independent of
s
s
. Our result applies to sub-Laplaicans on stratified Lie groups and Hermite operators on
R
n
\mathbb {R}^n
with
n
≥
2
n\ge 2
.