You are correct. In QuantLib python you should choose the appropriate class to get the interpolation method and variable you want.
Here is an example with some of the methods:
import QuantLib as ql
market_data = [
('DEPOSIT', '6M', -0.114),
('FRA', '6M', -0.252),
('FRA', '12M', -0.306),
('SWAP', '2Y', -0.325),
('SWAP', '3Y', -0.347)
]
helpers = ql.RateHelperVector()
index = ql.Euribor6M()
for instrument, tenor, rate in market_data:
rate /= 100
if instrument == 'DEPOSIT':
helpers.append(ql.DepositRateHelper(rate, index))
if instrument == 'FRA':
monthsToStart = ql.Period(tenor).length()
helpers.append(ql.FraRateHelper(rate, monthsToStart, index))
if instrument == 'SWAP':
helpers.append(
ql.SwapRateHelper(
rate, ql.Period(tenor), ql.TARGET(), ql.Annual,
ql.Following, ql.Thirty360(), index
)
)
params = [2, ql.TARGET(), helpers, ql.ActualActual()]
curves = {
"PiecewiseFlatForward": ql.PiecewiseFlatForward(*params),
"LogLinearDiscount": ql.PiecewiseLogLinearDiscount(*params),
"LogCubicDiscount": ql.PiecewiseLogCubicDiscount(*params),
"LinearZero": ql.PiecewiseLinearZero(*params),
"CubicZero": ql.PiecewiseCubicZero(*params),
"LinearForward": ql.PiecewiseLinearForward(*params),
"SplineCubicDiscount": ql.PiecewiseSplineCubicDiscount(*params)
}
If you inspect the discount factors for the curve nodes, they will be identical:
import pandas as pd
df = pd.DataFrame(index=[row[0] for row in curves['LogLinearDiscount'].nodes()])
for curve in curves:
dfs = [curves[curve].discount(idx) for idx in df.index]
df[curve] = dfs

But if you get discount factors from dates that are not given by the instruments used to build the curve, you will get diferent values because you are using diferent interpolation methods on different variables:
new_df = pd.DataFrame(index=[idx + ql.Period('15d') for idx in df.index])
for curve in curves:
curves[curve].enableExtrapolation()
dfs = [curves[curve].discount(idx) for idx in new_df.index]
new_df[curve] = dfs
