Deductions & credits

Your AMT credit is applicable to your federal tax, not just the capital gains income.  See, e.g.,

https://www.wikihow.com/Claim-AMT-Credit

for a step-by-step.  Note that line 54 now appears on 2018 Schedule 3.